Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Cannot determine consistent method resolution order (MRO) for "OrderedSet" when used with Python 2.7 #1

Closed
gvanrossum opened this issue Nov 13, 2018 · 2 comments

Comments

@gvanrossum
Copy link

I have installed those stubs for Python 2.7 and am manipulating mypy to find them, by running mypy as follows (~/v27 is a virtualenv):

mypy test.py --python-version 2.7 --python-executable~/v27/bin/python

This give me the error

/Users/guido/v27/lib/python2.7/site-packages/ordered_set-stubs/__init__.pyi:10: error: Cannot determine consistent method resolution order (MRO) for "OrderedSet"

When used with Python 3 all is well.

gvanrossum pushed a commit to python/typeshed that referenced this issue Nov 14, 2018
See rominf/ordered-set-stubs#1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
JelleZijlstra pushed a commit to python/typeshed that referenced this issue Nov 14, 2018
See rominf/ordered-set-stubs#1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
@rominf
Copy link
Owner

rominf commented Nov 14, 2018

Thank you for bug report, @gvanrossum!

@gvanrossum
Copy link
Author

Actually it looks like this was a bug in typeshed -- we're fixing it (though you'll have to wait for the next mypy release to get the fix). See python/typeshed#2602.

gvanrossum pushed a commit to python/typeshed that referenced this issue Nov 30, 2018
Instead define abstract __len__ in affected classes.

Fixes #2655 without breaking
rominf/ordered-set-stubs#1
gvanrossum added a commit to python/typeshed that referenced this issue Nov 30, 2018
Instead define abstract __len__ in affected classes.

Fixes #2655 without breaking
rominf/ordered-set-stubs#1
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this issue Jan 23, 2019
See rominf/ordered-set-stubs#1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this issue Jan 23, 2019
Instead define abstract __len__ in affected classes.

Fixes python#2655 without breaking
rominf/ordered-set-stubs#1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants