Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #95483 > unrolled thread
| Started by | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| First post | 2015-08-19 13:05 +0200 |
| Last post | 2015-08-19 13:05 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
Why the different parameter signatures to indicate blocking/timeouts. Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-08-19 13:05 +0200
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| Date | 2015-08-19 13:05 +0200 |
| Subject | Why the different parameter signatures to indicate blocking/timeouts. |
| Message-ID | <mailman.10.1439982421.28100.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web