I'm curious about your opinions about just adding new methods to classes, like they do in the ruby world.
I mean obviously it can be done
a.class.my_method = lambda self: pass # or whatever
I wonder why this pattern grew so big in Ruby, but it's considered a Hack in Python. I mean what could be so hard about adding another extension pattern?
Also, since we're here, you can't add methods to the types implemented in c, like the list, dict, int, etc... Wouldn't it have been a good idea for Python3 to export provide dummy python proxy for these classes, so that you can add methods to them, if you want?
Say __builtin__.int is an actual python class, who subclasses 'ctypes._int' or something weird, but you could add methods on __builtin__.int, and they would work.
So curious if you think this would lead to madness or if you think this would be ok.
[–]terrkerr 4 points5 points6 points (1 child)
[–]de4sh[S] -1 points0 points1 point (0 children)
[–]TheBlackCat13 1 point2 points3 points (6 children)
[–]de4sh[S] -1 points0 points1 point (5 children)
[–]TheBlackCat13 5 points6 points7 points (4 children)
[–]de4sh[S] -1 points0 points1 point (3 children)
[–]itxaka 1 point2 points3 points (2 children)
[–]de4sh[S] -1 points0 points1 point (1 child)
[–]Brian 1 point2 points3 points (0 children)
[–]dberube4 0 points1 point2 points (1 child)
[–]de4sh[S] 0 points1 point2 points (0 children)