Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Please help with Threading

Reply
Thread Tools

Re: Please help with Threading

 
 
Fábio Santos
Guest
Posts: n/a
 
      05-20-2013
It is pretty cool although it looks like a recursive function at first
On 20 May 2013 10:13, "Chris Angelico" <(E-Mail Removed)> wrote:

> On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson <(E-Mail Removed)> wrote:
> > _lock = Lock()
> >
> > def lprint(*a, **kw):
> > global _lock
> > with _lock:
> > print(*a, **kw)
> >
> > and use lprint() everywhere?

>
> Fun little hack:
>
> def print(*args,print=print,lock=Lock(),**kwargs):
> with lock:
> print(*args,**kwargs)
>
> Question: Is this a cool use or a horrible abuse of the scoping rules?
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>


 
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
Please help with Threading Jurgens de Bruin Python 13 06-03-2013 01:47 AM
RE: Please help with Threading Carlos Nepomuceno Python 0 05-20-2013 07:45 AM
Re: Please help with Threading Cameron Simpson Python 0 05-20-2013 07:45 AM
Re: Please help with Threading Cameron Simpson Python 0 05-19-2013 03:10 AM
Help with printing a bit pattern with printf and %x matt.jaffe@gmail.com C Programming 9 04-19-2013 12:14 PM



Advertisments