Skip to content

INTERNAL ERROR #3561

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
leandropls opened this issue Jun 16, 2017 · 9 comments
Closed

INTERNAL ERROR #3561

leandropls opened this issue Jun 16, 2017 · 9 comments

Comments

@leandropls
Copy link

I've just got one of these:

INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-88fe21d5e570160e790384d62c75ee1234e6a597
Traceback (most recent call last):
  File "/Users/leandro/env/acg-3.6.1/bin/mypy", line 6, in <module>
    main(__file__)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/main.py", line 46, in main
    res = type_check_only(sources, bin_dir, options)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/main.py", line 93, in type_check_only
    options=options)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/build.py", line 188, in build
    graph = dispatch(sources, manager)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/build.py", line 1570, in dispatch
    process_graph(graph, manager)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/build.py", line 1813, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/build.py", line 1912, in process_stale_scc
    graph[id].type_check_first_pass()
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/build.py", line 1485, in type_check_first_pass
    self.type_checker.check_first_pass()
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 177, in check_first_pass
    self.accept(d)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 262, in accept
    stmt.accept(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/nodes.py", line 748, in accept
    return visitor.visit_class_def(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 1077, in visit_class_def
    self.accept(defn.defs)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 262, in accept
    stmt.accept(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/nodes.py", line 809, in accept
    return visitor.visit_block(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 1170, in visit_block
    self.accept(s)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 262, in accept
    stmt.accept(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/nodes.py", line 630, in accept
    return visitor.visit_decorator(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 2207, in visit_decorator
    e.func.accept(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/nodes.py", line 564, in accept
    return visitor.visit_func_def(self)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 510, in visit_func_def
    self.check_method_override(defn)
  File "/Users/leandro/env/acg-3.6.1/lib/python3.6/site-packages/mypy/checker.py", line 942, in check_method_override
    for base in defn.info.mro[1:]:
TypeError: 'NoneType' object is not subscriptable
@refi64
Copy link
Contributor

refi64 commented Jun 16, 2017

...example code? It's kind of hard to debug a problem otherwise...

@ilevkivskyi
Copy link
Member

Could you please tell us what are the flags you are using? In particular, do you --incremental flag?

@leandropls
Copy link
Author

leandropls commented Jun 16, 2017

@kirbyfan64,

from typing import NamedTuple, TypeVar, Type

T = TypeVar('T')


class MyClass(NamedTuple):
    first: float
    second: float

    @classmethod
    def fromnumber(cls: Type[T], value: float) -> T:
        return cls(value / 2, value / 2)

@ilevkivskyi, no special flags needed.

@refi64
Copy link
Contributor

refi64 commented Jun 16, 2017

This doesn't crash under master:

ryan@DevPC-LX ~/stuff/mypy master $ mypy nt.py
nt.py:12: error: Too many arguments for "object"
ryan@DevPC-LX ~/stuff/mypy master $ 

@leandropls
Copy link
Author

Hasn't this been settled here?
python/typing#352

@leandropls
Copy link
Author

Oh, sorry, I was responding to a comment that doesn't really exist anymore.

@gvanrossum
Copy link
Member

If the crash is fixed in master, close the issue please.

@leandropls
Copy link
Author

Is this really supposed to be an error? Even if it doesn't crash. It seems fr the issue above, that the code should be valid.

@ilevkivskyi
Copy link
Member

@leandropls

There is a proposal (proto-PEP "Data classes") to add a support for such use cases (both runtime and static). NamedTuple should be kept rather minimalistic.

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

No branches or pull requests

4 participants