[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement
Steve Holden
steve at holdenweb.com
Tue Mar 3 01:08:25 CET 2009
Guido van Rossum wrote:
> On Mon, Mar 2, 2009 at 3:43 PM, Raymond Hettinger <python at rcn.com> wrote:
>> [GvR]
>>> *Maybe* the "built-in status" should guide the
>>> capitalization, so only built-in types are lowercase (str, int, dict
>>> etc.).
>> That makes sense.
>>
>>
>>> Anyway, it seems the collections module in particular is already
>>> internally inconsistent -- NamedTuple vs. defaultdict.
>> FWIW, namedtuple() is a factory function that creates a class, it isn't
>> a class itself. There are no instances of namedtuple(). Most functions
>> are all lowercase. Don't know if that applies to factory functions too.
>
> This is unfortunately ambiguous; e.g. threading.Lock() is a factory
> function too. Anyways, I was mistaken about this example; I should
> have pointed to Counter and the UserXxx classes in collections.py.
>
> On Mon, Mar 2, 2009 at 3:44 PM, Armin Ronacher <armin.ronacher at active-
>> I suppose you mean "DefaultDict".
>
> Yes, I've been distracted. :-(
>
>> That would actually be the best solution.
>> Then the module would be consistent and the new ordered dict version would go by
>> the name "OrderedDict".
>
> OK.
>
>> PS.: so is datetime.datetime a builtin then? :)
>
> Another historic accident. Like socket.socket. :-(
>
A pity this stuff wasn't addressed for 3.0. Way too late now, though.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-Dev
mailing list