New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop polluting builtins from PythonUtil. #1256
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1256 +/- ##
==========================================
- Coverage 16.92% 16.14% -0.79%
==========================================
Files 3632 3744 +112
Lines 340864 362805 +21941
==========================================
+ Hits 57694 58571 +877
- Misses 283170 304234 +21064
Continue to review full report at Codecov.
|
While I agree with the spirit of the changes, this looks like an API-breaking change. |
Messing with PythonUtil is guaranteed to upset those guys maintaining old Disney games. Though, given that it has happened a couple of times, I suspect they have stopped relying on PythonUtil by now, but who knows. IIRC If anything, I'd recommend removing the most obscure ones first. |
Yeah, I think that the overall health of panda3d is more important. Polluting builtins with commonly used names is a recipe for bugs. @loblao Once again this PR does not remove anything. if anyone really wants to keep using their builtins they can add them manually in their own code, Or, you know, just Also this is proposed for Panda3D 1.11, which is exactly the place for breaking changes. @Moguri |
1.11 is not the place for breaking changes. Breaking changes should only occur in a major version bump (e.g., 2.0). However, I agree that some of those names are problematic and ripe for unexpected name collisions. I do not know @rdb's opinion on the matter, but I would prefer we at least move these builtin assignments to a new module so the behavior can be restored with one line of code (importing the new module). |
This is by no means a documented API and there have been plenty of much more significant changes between say 1.9 and 1.10.
|
Issue description
This PR prevents PythonUtil from polluting the builtins with it's classes and functions.
Polluting builtins can cause many unintended bugs or oddities and is considered bad practice.
Solution description
This PR removes the section in PythonUtil that adds all the functions and classes to builtins.
No utilities are being removed in this PR.
If you would like to use one of these classes, you would simply need to import them.
Checklist
I have done my best to ensure that…