[Python-Dev] Classes that claim to be defined in builtin but aren't (original) (raw)
Brett C. bac at OCF.Berkeley.EDU
Sun Aug 15 08:09:09 CEST 2004
- Previous message: [Python-Dev] Classes that claim to be defined in __builtin__ but aren't
- Next message: [Python-Dev] Classes that claim to be defined in __builtin__ but aren't
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote:
Sooo should (for 'generator' in objects that claim to be in builtins but aren't), 1) 'generator' be added to builtins 2) 'generator' be added to types.py and its module be set to 'types' 3) 'generator' be added to .py and its module be set to '' (and a name for the module chosen)
I guess (1).
The problem I see with explicitly adding this stuff to builtins is that tab-completion in the interpreter is suddenly going to have all of this extra stuff that people are not going want to really see that often.
The other point I would like to make is that almost everything in builtins is either an exception, a singleton (thinking of True and False), or a function (even thinking of list and dict since you can use their factory methods). The only exceptions I can think of are name and that is just part of the design. Throwing in generator and any of the other types that are defined by the built-in types will go against all of this unless we create factory methods for them which is not really desired since they are returned only in certain situations.
I personally prefer option 2.
-Brett
- Previous message: [Python-Dev] Classes that claim to be defined in __builtin__ but aren't
- Next message: [Python-Dev] Classes that claim to be defined in __builtin__ but aren't
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]