osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PyPy support breaking CPython compatibility?



Le 2018-01-30 ? 16:38, Ned Batchelder a ?crit?:
>> I'm confused by this:
>>
>> -if os.environ.get('SCHEVO_OPTIMIZE', '1') == '1':
>> +if os.environ.get('SCHEVO_OPTIMIZE', '1') == True:
>>
> I was also curious about this: when does os.environ.get return 
> anything but a string? 

I was probably high when I coded this! ;)

I think a better solution is to write :

if os.environ.get('SCHEVO_OPTIMIZE', '0')? == '1':
 ?...

Anyways, what do you think about the weakref case?

Etienne


-- 
Etienne Robillard
tkadm30 at yandex.com
https://www.isotopesoftware.ca/