Question:
I’m learning Cython and ran into the following weird bugself.km
set to 0 when I try to read it from miles
and meters
?Answer:
miles
, meters
and km
– the properties and the cdef variables with the same name.Cython looks to be reading from the cdef variables, which will be automatically zero initialized.
If you have better answer, please add a comment about this, thank you!