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 <newmodule>.py and its __module__ be set to >>'<newmodule>' (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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4