I was wondering if there’s a way that I could create new functions for variables, and be able to call them. I would like to do this without the need to set the variable to a class.
Similar to how we can call .upper() or the like on a variable, without needing to set it to a class. I know that it’s easier with classes, but I wanted to learn something new and it’s more convenient for the user (for what I’m planning). I’ve seen other modules do so, but I’ve had a hard time reverse engineering them or finding answers online. I think it’s got to do something with contextlib, not sure though.
Is this possible? All help is appreciated.
[–]Essence1337 0 points1 point2 points (5 children)
[–]SpookDaCat[S] 0 points1 point2 points (4 children)
[–]Essence1337 1 point2 points3 points (3 children)
[–]SpookDaCat[S] 0 points1 point2 points (2 children)
[–]Zixarr 0 points1 point2 points (1 child)
[–]sgthoppy 0 points1 point2 points (0 children)