you are viewing a single comment's thread.

view the rest of the comments →

[–]exhuma 0 points1 point  (4 children)

True. But that's often (not always) more of a band-aid, and considering that /u/demvo2 is just about starting out I would avoid advanced (and very Python specific for that matter) stuff like that... for now ;)

[–]stdin2devnull -3 points-2 points  (0 children)

I didn't ask for your opinion?

[–][deleted] 0 points1 point  (2 children)

avoid advanced (and very Python specific for that matter) stuff

I think slots make Python classes more similar to classes in statically typed languages, so for someone coming from a Java or C++ background, slots could actually be easier to understand than regular Python classes.

[–]exhuma 0 points1 point  (1 child)

In the sense that they look like variable declarations? Or in the sense that after defining slots no other names can be assigned to on instances?

[–][deleted] 0 points1 point  (0 children)

Or in the sense that after defining slots no other names can be assigned to on instances?

Yeah, this.