Skip to content

Conversation

@dbieber
Copy link

@dbieber dbieber commented Feb 23, 2018

cmpops, binops, and unops already used this technique, but boolops did not.
The reason this technique is preferred to using class for the lookup is that when working with e.g. gast (a cross version compatible AST) the exact type match required by the class lookup fails (since gast.And != ast.And), whereas the name based lookup works fine.

@dbieber dbieber changed the title Use __class__.__name__ for boolops loopup Use __class__.__name__ for boolops lookup Feb 23, 2018
@dbieber
Copy link
Author

dbieber commented Feb 28, 2018

The failure is in Python 3.6 only
self.check_roundtrip('f"{key:4}={value!s}"').

Thoughts on why my change breaks this?

cmpops, binops, and unops already used this technique, but boolops did not.
The reason this technique is preferred to using __class__ for the lookup is that when working with e.g. gast (a cross version compatible AST) the exact type match required by the __class__ lookup fails (since gast.And != ast.And), whereas the name based lookup works fine.
@dbieber
Copy link
Author

dbieber commented Oct 1, 2018

Rebased.

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.

1 participant