Page MenuHome

Switch to new style objects in Python
AbandonedPublic

Authored by Rasmus Petersen (yoff) on Jan 23 2019, 6:16 PM.

Details

Summary

We are using old style objects in a few places, but also using the slots feature which is only available for new style objects.

See for instance this alert the small help icon to the far right links to a more detailed explanation.

These were found using LGTM.com, the producers of which I now happen to work for. I would be happy, if it could turn out to be useful for blender :-)

I just assigned a single reviewer, feel free to push this around...

Diff Detail

Event Timeline

Old-style classes are removed in Python 3, leaving only new-style classes.

https://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes

Old-style classes are removed in Python 3, leaving only new-style classes.

Thanks for the very quick review! So I guess we have switched to python 3 everywhere? I had noticed this line in blender-thumbnailer.py:

Thumbnailer runs with python 2.7 and 3.x.

Perhaps this comment is then the only thing that might need fixing :-)