so I was trying to think of ways to reduce python's memory usage when you write your code.
my logic is telling me your class instances will use less memory if you write your class functions before writing your class:
def classfunc( inst, arg ):
pass
class mainclass: pass
inst = mainclass()
classfunc( inst, 0 )
when you instance mainclass, classfunc will not be defined for each instance.
instead, classfunc would only be defined once for the module.
is my logic correct??
also, is it possible to map the defined function into a class during instantation??
this way the class behaves like it should inst.classfunc()
, but doesn't redefine the function.