Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing types to __builtin__ #40765

Closed
foom mannequin opened this issue Aug 16, 2004 · 5 comments
Closed

Add missing types to __builtin__ #40765

foom mannequin opened this issue Aug 16, 2004 · 5 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@foom
Copy link
Mannequin

foom mannequin commented Aug 16, 2004

BPO 1009811
Nosy @loewis
Files
  • addbuiltin.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2007-03-12.08:58:09.000>
    created_at = <Date 2004-08-16.05:00:18.000>
    labels = ['interpreter-core']
    title = 'Add missing types to __builtin__'
    updated_at = <Date 2007-03-12.08:58:09.000>
    user = 'https://bugs.python.org/foom'

    bugs.python.org fields:

    activity = <Date 2007-03-12.08:58:09.000>
    actor = 'loewis'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2004-08-16.05:00:18.000>
    creator = 'foom'
    dependencies = []
    files = ['6189']
    hgrepos = []
    issue_num = 1009811
    keywords = ['patch']
    message_count = 5.0
    messages = ['46715', '46716', '46717', '46718', '46719']
    nosy_count = 3.0
    nosy_names = ['loewis', 'collinwinter', 'foom']
    pr_nums = []
    priority = 'normal'
    resolution = 'postponed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1009811'
    versions = ['Python 2.4']

    @foom
    Copy link
    Mannequin Author

    foom mannequin commented Aug 16, 2004

    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>

    @foom foom mannequin closed this as completed Aug 16, 2004
    @foom foom mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 16, 2004
    @foom foom mannequin closed this as completed Aug 16, 2004
    @foom foom mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 16, 2004
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jan 27, 2005

    Logged In: YES
    user_id=21627

    I don't like to see further __builtin__ pollution, so I
    recommend to reject this patch.

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Mar 11, 2007

    I agree with Martin. This is going to be taken care of in Python 3 (somehow) regardless.

    @foom
    Copy link
    Mannequin Author

    foom mannequin commented Mar 11, 2007

    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.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Mar 12, 2007

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants