Edward Loper wrote: > Is this also intended for use as a base class? With Amin's latest sugestion, yes. That is the real win with his suggestion. > In particular, it seems > like if I have a class Foo, then I can make a thread-local version with > the following (as long as Foo doesn't rely on overriding > __getattribute__/__setattr__). > > class LocalFoo(local, Foo): pass > > Is that right? (I can see how it works in the Python implementation, > but don't know enough about extensions to see if that translates > directly to the c implementation.) Yup > Actually, does local.__init__() need a call to super(self, > local).__init__() to make this work? Init gets pretty weird for thread-local objects. You sort of want to run __init__ (if there is one) every time you compute a dict for a thread. Jim -- Jim Fulton mailto:jim at zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4