Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: __builtins__ thread-safe / __builtins__ as function?

Reply
Thread Tools

Re: __builtins__ thread-safe / __builtins__ as function?

 
 
Chris Angelico
Guest
Posts: n/a
 
      10-11-2012
On Fri, Oct 12, 2012 at 1:16 AM, Juergen Bartholomae
<(E-Mail Removed)> wrote:
> One possible solution is to somehow redirect every __builtins__ to a
> function that returns a different __builtins__ dictionary for each thread
> (such a function already exists).


How exactly does the code reference it? If they're simply referring to
the name __builtins__ at module level, you ought to be able to import
the module, then assign some_module.__builtins__ to your thread-local
object, then call code in it as normal.

An interesting problem, and one where monkeypatching is, imho, justified.

ChrisA
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: __builtins__ thread-safe / __builtins__ as function? Chris Angelico Python 0 10-14-2012 02:01 PM
Adding objects to __builtins__ Matteo Merli Python 1 06-02-2004 07:20 PM
A second __builtins__- or globals()-like namespace. Jacek Generowicz Python 1 04-08-2004 01:31 PM
"Virtual" file system mock object - replacing stuff in __builtins__ Remy Blank Python 3 03-06-2004 12:20 AM
Using the __builtins__ module to assign new global variables Opinder Python 1 03-02-2004 12:49 AM



Advertisments