3 ms·
Exactly. If I do glyphA.contours[0].points[0].x = 1 what happened to someone else holding a reference to the same glyph? To a python programmer it might not b
by alkonaut 5y ago
Exactly. If I do glyphA.contours[0].points[0].x = 1
what happened to someone else holding a reference to the same glyph? To a python programmer it might not be a surprise to see such an API (a shared mutable value), but to most OO programmers I hope this API looks very strange.
- dexwiz 5y agoThe conclusion in the article that using a getter/setter would fix most of the issues seems much more straight forward. Maybe I don't write enough python, but I rarely think modifying properties on a library object is preferable over clearly named methods.
- alkonaut 5y agoHow the object is mutated isn't really relevant to the smell. It's that an object can be mutated while someone else has a reference to it (and that the API is designed that way),