[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

Guido van Rossum guido at python.org
Tue Mar 3 00:47:22 CET 2009


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. :-(

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list