import copyfrom gluon.storage import Storageclass AAA(Storage): @property def f(self): return 'ff' a=AAA()print a.fb = copy.copy(a)print b.f
'ff'
None
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I know, I remember that optimizations. The proposed version actually follows a similar idea of FastStorage.In particular, attributes are handled as in a common class, items are mapped into self.__dict__, no more dict as super class (unfortunately I had to redefine many common methods). A further optimization can be the introduction of lambda instead of explicit method def.Paolo
--
I fully agree with you.I started working on it in order to aggregate the same code we have in Row, Table, DAL etc in a simple (super) class. To some extent, that class is actually Storage, optimizing it is like a 'side' effect, not mandatory off course. How should I check I don't have memory leaks?
for n in xrange(1000000):
import gc
gc.collect()
ad = FastStorage()
ad['x'] = n
ad.y = ad.x
print n, ad.x, ad.y
--