fix: local struct shadows included module#324
fix: local struct shadows included module#324FrankPortman wants to merge 4 commits intoThriftpy:masterfrom
Conversation
|
@aisk not sure if you are the current maintainer but I see you have the most commits in the last half year so please take a look when you can 🙏 |
|
Friendly bump - @cocolato tagging you as well since I see some recent activity from you. Some initial direction to this PR or the underlying issue would be great! |
|
thriftpy2/thriftpy2/parser/parser.py Lines 82 to 84 in 8e82f1c thriftpy2/thriftpy2/parser/parser.py Lines 244 to 248 in 8e82f1c p_seen_struct method overwrites the contents of the originally imported module via setattr. Although the current fix resolves this issue, I suggest using a prefix with setattr to better distinguish between the imported module and the struct. @aisk please take a look.
|
Thank you for reviewing! You're correct that The current fix preserves backward compatibility by using the already-available If you'd prefer a different approach, I'm happy to adjust, but I believe this is the least disruptive fix for users. Caveat - I am obviously very new to this project so it is possible I missed something in your recommendation. At the end of the day, any approach that fixes #323, either with this PR or a different PR, would be fine for me. |
aisk
left a comment
There was a problem hiding this comment.
I'd like to mark this as pending further discussion. Since we don’t have a mechanism to put a PR on hold, I’ve set it to Request Changes instead.
fixes: #323