charolastra

joined 1 year ago
[–] charolastra@programming.dev 2 points 1 week ago

Plus one for pyenv

[–] charolastra@programming.dev 3 points 3 months ago* (last edited 3 months ago)

Keyword "typically". If I'm overriding dunder methods, then I'll typically need to call the super method as well. It's not like it's forbidden.

Consider the following:

class MyStr(str):
     def len(self):
          return len(self)
          # OR
          return self.__len__()

Both of the above return values are perfectly valid Python.

[–] charolastra@programming.dev 3 points 3 months ago* (last edited 3 months ago) (2 children)

At the end of the day, len(ob) just defers to ob.__len__() so both are correct, just one's more functional and one's more object oriented.

[–] charolastra@programming.dev 0 points 10 months ago (2 children)

Check out Tauri.app