Nils Bruin schrieb am 25.12.23 um 20:39:
This was fixed in Cython 3.0 to match the normal Python behaviour. There is
no option to turn this off.
https://docs.python.org/3/tutorial/classes.html#private-variables
A double underscore prefix represents a private name in Python that is not
meant to be accessed from the outside or even from subclasses. Thus the
mangling. Your best options are to a) not use the private attribute from
outside the class or b) rename the attribute to allow external usage. For
other options, including the chance that Cython is doing something
different from Python here, I'd need more info about the types involved here.
Stefan