Marek Otahal added the comment:
EDIT:
> i.foo_long(1337)
ofc, this should be:
i.foo_long('hi', cacheSize=1337)
or for (2):
class MyLib():
def __init__(arg1, arg2):
self._cacheSize = someComputation(arg1, arg2) # returns a number
@lru_cache
def foo_long(self, arg1, **kwds):
pass
#user
import MyLib
i = MyLib(100, 21)
# not to make it so simple:
i.changeInternalStateSomehow() # updates arg1, arg2, and also _cacheSize
i.foo_long(1337, cacheSizeName='_cacheSize') # ref to self._cacheSize
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24969>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com