Skip to content

Remove @builtinclass #599

Closed
Closed

Description

@JukkaL

The PEP 484 draft doesn't have @builtinclass, so remove it. Alternatively, figure out an alternative way of encoding this information.

Activity

  1. elazarg commented on Oct 17, 2016

    @elazarg
    Contributor

    If I am not mistaken, it can be removed right now. No test demonstrate a need for it.

    The only use of this information inside mypy (through ClassDef.is_builtinclass) is in nearest_builtin_ancestor(), called from check_multiple_inheritance() in checker.py[1]. Replacing

    -        if base.defn.is_builtinclass:
    +        if base.defn.fullname == 'builtins.object':

    passes all the tests[2], except the whitebox-test testBuiltinclassDecorator in semanal-classes.test, but this test only verifies that the implementation tracks this information.

    [1] It resides on meet.py, for some reason, adding an unnecessary dependency
    [2] Otherwise it could be replaced with looking up the decorator. Or keeping a list of builtin classes

  2. gnprice commented on Oct 20, 2016

    @gnprice
    Collaborator

    Thanks for investigating! Sounds like a small patch with that cleanup would be great.

  3. added this to the milestone on Oct 20, 2016
  4. gvanrossum commented on Oct 22, 2016

    @gvanrossum
    Member

    Let's leave this open until it's also removed from typeshed (two lines).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions