A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2012-January/116043.html below:

[Python-Dev] threading.Semaphore()'s counter can become negative for non-ints

[Python-Dev] threading.Semaphore()'s counter can become negative for non-ints [Python-Dev] threading.Semaphore()'s counter can become negative for non-intsT.B. bauertomer at gmail.com
Tue Jan 31 19:46:54 CET 2012
On 2012-01-31 00:23, Benjamin Peterson wrote:
> 2012/1/30 Nick Coghlan<ncoghlan at gmail.com>:
>> On Tue, Jan 31, 2012 at 8:11 AM, Matt Joiner<anacrolix at gmail.com>  wrote:
>>> It's also potentially lossy if you incremented and decremented until integer
>>> precision is lost. My vote is for an int type check. No casting.
>>
>> operator.index() is built for that purpose (it's what we use these
>> days to restrict slicing to integers).
>>
>> +1 for the type restriction from me.
>
> We don't need a type check. Just pass integers (obviously the only
> right type) to it.
>
>
When a float is used, think of debugging such a thing, e.g. a float from 
integer division. I don't care if float (or generally non-integers) are 
not allowed in threading.Semaphore, but please make it fail with a bang.

Regards,
TB
More information about the Python-Dev mailing list

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