-
Notifications
You must be signed in to change notification settings - Fork 312
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
Scene improvements #1651
Comments
Another source of bugs is that We should also cover all these cases in unit tests. |
You can't make things in python private. I think the best way to go about this is to give warnings and comments in the code. I am also trying to getting to detect when it is happening. |
I know. I guess non-public is a better word. Just starting the name with an underscore. Most programmers know this means you shouldn't really access it or that there might be some bad consequences for doing so. Trying to avoid this happening is usually not worth it. (PEP 8) We do this everywhere in the arcade codebase. |
improved scene, made it 2 variables non-public(issue pythonarcade#1651)
improved scene, made it 2 variables non-public(issue #1651) Co-authored-by: Grant Hur <22hurg@sjchrisitan.org>
@einarf I think you can close this. |
I'd like to take another look at this before closing. |
I think adding |
@Cleptomania are you all at PyCon? Would love to try tackling this issue if someone hasn't already claimed it. I tried finding the Arcade group in 250D but was unsuccessful. |
@tiffanyxiao Just missed us! We went out to lunch but will be back this afternoon. I’ll also be around for Tuesday and Wednesday |
Your help would be appreciated! |
What else needs to be added to this? |
I think everything we wanted to hit is done with this. If there are any further desired improvements they should get their own smaller scoped issues now. |
The current
sprite_lists
andname_mapping
members are "public". Some users are modifying these directly causing issues that are hard to debug and understand. We should make them private and add additional tools if needed.arcade/arcade/scene.py
Lines 30 to 32 in 98d4cac
Things like
__len__
and__delitem__
are candidates here.On a few occations users have been deleting spritelists from
name_mapping
thinking that this will remove the spritelist. For more dynamic worlds this means you end up with hundres of spritelists inspritelists
and performance tanks.The text was updated successfully, but these errors were encountered: