Rename allow_redefinition to allow_redefinition_old#373
Conversation
cgoldberg
left a comment
There was a problem hiding this comment.
This change would require pinning Mypy in refurb to >=1.20.0 or else it will break environments that have an older version installed.
Maybe:
try:
opt.allow_redefinition_old = True
except AttributeError:
opt.allow_redefinition = True
|
@cgoldberg your In regards to Refurb's use of MyPy's internal classes, see python/mypy#16497 (comment):
MyPy does not -- nor should they, necessarily -- use semantic versioning for their internal APIs, because they aren't meant to be used directly by 3rd party libraries. This means that tools like Refurb will have to be on the ball with new releases. There should probably be a cronjob that runs CI against the latest MyPy commit, that way these sorts of issues are detected before a MyPy release is published. |
I added that in #374 |
|
Do I change my PR to a try ... except ? |
yes, or else it will break on older versions of Mypy |
|
@chdemko this looks like a nicer option, and should work for old and new versions: #372 (comment) |
|
@chdemko if this works, it's probably better than setting the attribute directly on |
|
Sorry @chdemko , I went down the |
Closes dosisod#372 Closes dosisod#373
Fix #372