Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95483

Why the different parameter signatures to indicate blocking/timeouts.

Date 2015-08-19 13:05 +0200
From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
Subject Why the different parameter signatures to indicate blocking/timeouts.
Newsgroups comp.lang.python
Message-ID <mailman.10.1439982421.28100.python-list@python.org> (permalink)

Show all headers | View raw


I have been looking through the threading module and I am
a bit annoyed at the different signatures for indicating
whether some calls should block or not and the timeout.

On the one hand we have the acquire on locks with the following
signature: def accquire(blocking=True, timeout=-1)

On the other hand we have wait and join methods with this
signature: def join(timeout=None).

As far as I understand 

timeout=None is equivallent to: blocking=True, timeout=-1
timeout=NR   is equivallent to: blocking=True, timeout=NR.
timeout=0    is equivallent to: blocking=False, timeout=-1

which may be equivallent to : blocking=True, timeout=0

Can someone explain why these different signatures, or
should I consider this a relict from the past?

-- 
Antoon Pardon ////

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Why the different parameter signatures to indicate blocking/timeouts. Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-08-19 13:05 +0200

csiph-web