Python #ifdef

Carlos Nepomuceno carlosnepomuceno at outlook.com
Tue May 28 16:22:40 EDT 2013


----------------------------------------
> From: invalid at invalid.invalid
> Subject: Re: Python #ifdef
[...]
> You're trying to make this a lot harder than it really is:
>
> if sys.version_info[0] == 3:
> def original(n):
> m = 0
> for b in n.to_bytes(6, 'big'):
> m = 256*m + b
> return m
> else:
> def original(n):
> <something else?>
>
>
> --
> Grant Edwards grant.b.edwards Yow! Am I having fun yet?
> at
> gmail.com

Haha! That's it!!!

Just realized how funny this can be: ;)

### never to be opened ###
def pandoras_box(v):
    return v/0.0

if customer_didnt_pay():
    pandoras_box()

#lol 		 	   		  


More information about the Python-list mailing list