lordmauve / wasabi2d

Cutting-edge 2D game framework for Python
https://wasabi2d.readthedocs.io/
GNU Lesser General Public License v3.0
156 stars 24 forks source link

Attribute permanence #28

Open larryhastings opened 4 years ago

larryhastings commented 4 years ago

If I set an attribute on a passive object, I expect that if I later get that attribute, it won't have changed. For example, I'm in control of shape.pos; my program is the only person who sets it, it doesn't change independently of of its own accord. Therefore, if I set shape.pos = xyz, and I don't change it, I expect the expression "shape.pos is xyz" to evaluate to True.

wasabi2d has an unfortunate habit of rewriting attributes to its own preferred format. For example, I believe when I write shape.pos, the shape object notices and overwites the value with a numpy 2-value array. This effectively meant that I had to store shape.pos in two places.

Please change wasabi2d so that it doesn't overwrite attributes in this way. If it wants its numpy 2-value array, it can store that in another attribute, maybe with an underscore in front (pos = _pos?).