classification
Title: Add missing types to __builtin__
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: postponed
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter, foom, loewis
Priority: normal Keywords: patch

Created on 2004-08-16 05:00 by foom, last changed 2007-03-12 08:58 by loewis. This issue is now closed.

Files
File name Uploaded Description Edit
addbuiltin.patch foom, 2004-08-16 05:00
Messages (5)
msg46715 - (view) Author: James Y Knight (foom) Date: 2004-08-16 05:00
Add most of the missing type objects to __builtin__.

Adds the following:
ellipsis (not to be confused with Ellipsis, which is the object of this 
type)
builtin_function_or_method
dictproxy
generator
PyCObject
classobj
instance
instancemethod
cell
NoneType
NotImplementedType
frame
function
module
traceback
code

Does not add the rest of the names mentioned in my email, as I'm 
unsure if they got an approval or were silently ignored. I'm not 
convinced that it's a good idea to put the rest in __builtin__, myself.

See also:
<http://mail.python.org/pipermail/python-dev/2004-August/
047754.html>
and
<http://mail.python.org/pipermail/python-dev/2004-August/
047830.html>
msg46716 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-01-27 06:20
Logged In: YES 
user_id=21627

I don't like to see further __builtin__ pollution, so I
recommend to reject this patch.
msg46717 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-11 18:39
I agree with Martin. This is going to be taken care of in Python 3 (somehow) regardless.
msg46718 - (view) Author: James Y Knight (foom) Date: 2007-03-11 23:47
I only submitted this because I was directed to. To reiterate, the actual problem is that the classes claim to be defined in a place they aren't actually defined in.

Quoting myself:
Sooo should (for 'generator' in objects that claim to be in __builtin__ but aren't),
1) 'generator' be added to __builtin__
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)

Me, I'm pretty much agnostic towards which solution is chosen, and if this one isn't it, fine with me. I just want to see python be truthful about where types are defined, whatever form that takes.
msg46719 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-03-12 08:58
There are more options, e.g. __module__ set to None, and generator being in no module. I think this is the one I would prefer. In any case, it seems very difficult to achieve consensus on this, so it just won't get fixed for the moment.
History
Date User Action Args
2004-08-16 05:00:18foomcreate