Re: PEP 420 issue: extend_path

"Eric V. Smith" <[email protected]>
Newsgroups gmane.comp.python.import
Message-ID <[email protected]>
On 5/9/2012 12:14 PM, Barry Warsaw wrote:
> On May 09, 2012, at 06:19 PM, Nick Coghlan wrote:
> 
>> Eric's counter-proposal is to handle the 3 scenarios as:
>>
>> 1. (<loader>, <don't care>)
>> 2. (None, [<path entries>])
>> 3. (None, [])
> 

...

> I'd like to relax the formal specification just a bit though, so that the
> second element is a sequence, not necessarily a concrete list.

I was going to say just use whatever list.extend() is documented to
accept, but I notice that's "list" [1]. I would assume it can really be
any iterable. But since len() is called on it (in case 3, above), I
guess "sequence of strings" is the best description.

But if case 3 were changed to (None, None), then I wouldn't need to call
len(), and it could be any iterable returning strings in case 2. What
are your thoughts on making case 3 (None, None)? I sort of like it.

For case 1, I'm currently returning "<don't care>" part as an empty
string. Should I document it as that, or as really "<don't care>"? I
don't have an opinion on this.

Eric.

[1]: http://docs.python.org/tutorial/datastructures.html#more-on-lists
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.