Skip to content

Remove @builtinclass #599

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

Closed
JukkaL opened this issue Mar 14, 2015 · 3 comments
Closed

Remove @builtinclass #599

JukkaL opened this issue Mar 14, 2015 · 3 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 14, 2015

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

@elazarg
Copy link
Contributor

elazarg commented Oct 17, 2016

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

@gnprice
Copy link
Collaborator

gnprice commented Oct 20, 2016

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

@gvanrossum gvanrossum added this to the 0.5 milestone Oct 20, 2016
gvanrossum pushed a commit that referenced this issue Oct 22, 2016
Following #599.

(As a followup, we should remove it from typeshed too.)
@gvanrossum
Copy link
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
Projects
None yet
Development

No branches or pull requests

4 participants