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

User defined callable (Work In Progress) #1644

Closed
wants to merge 5 commits into from

Conversation

margaret
Copy link
Contributor

@margaret margaret commented Jun 4, 2016

Trying to fix #797

Currently debugging broken tests, specifically things like

class A(type):
    def __init__(self) -> None: pass
def f(x: type): pass
f(A())

Do not work and return
error: Argument 1 to "f" has incompatible type Callable[[Any, Any], Any]; expected "type"

margaret added 5 commits June 2, 2016 16:50
- Re-raise the LookupError as a slightly more helpful DecodeError
- Catch the DecodeError and raise as CompileError so the BuildManager will
handle it instead of crashing.
- In cmdline.test so the file parsing happens in build.py. The tests in
parse-errors.test call the parse() method in parse.py directly.
- Tests are NOT passing I think because something that checks for
subtype gets builtins.function instead of the defined class
- previously was set as builtins.function because it was being created
from the __call__ FuncDef
@gvanrossum
Copy link
Member

I am closing this for lack of progress. Margaret, if you want to work on this again, please re-open the PR!

@gvanrossum gvanrossum closed this Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Classes with __call__ defined should be a subtype of Callable
2 participants