You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a non-docstring string, we should not change its value. Similarly, we shouldn't change x.foo.bar to x.foo.baz; there's no guarantee they mean the same thing.
The text was updated successfully, but these errors were encountered:
Changing inside strings and comments seem to be by design:
For the rest of the code body, transform_imports() does a crude textual
string replacement. This is imperfect but handles most cases. There may
be some false positives, but this is difficult to avoid. Generally we do
want to do replacements even within in strings and comments.
My guess is this is ment for getattr and alike.
With the current architecture of transforms, that just do string replace on blocks, the easy option is to add a flag to only touch top level imports, and not the rest of the code.
Having something with more fine grained options (touching only docstrings), will need a more complex rewrite of the transformations pipeline to work on ast nodes. It will probably take ~50h seeing the complexity.
Let me know if you want me to just add a flag to touch top level module imports or try to investigate more how to do proper transforms.
If we have a non-docstring string, we should not change its value. Similarly, we shouldn't change x.foo.bar to x.foo.baz; there's no guarantee they mean the same thing.
The text was updated successfully, but these errors were encountered: