wim

London, United Kingdom

google.com

Age: 33

Hi from London, England! I hope my answers have been helpful for you. Python developer with interest in mathematics, music, robotics and computer vision.

project euler progress badger badger badger

[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
10h
revised how to get the return value from a thread in python?
added 4 characters in body
16h
comment What to do when my comment has been reposted as an answer by another user?
tempted to steal the comment of @KenWhite and add as my answer ..
16h
comment encoding string to utf in python
I don't think 'iso-8859-1' is the right encoding. That will give you ñ instead of é.
16h
comment encoding string to utf in python
that string (bytes) is already encoded. you need to .decode it to get a unicode object.
16h
revised encoding string to utf in python
deleted 1 character in body
16h
revised encoding string to utf in python
deleted 66 characters in body
19h
revised How to upgrade optparse() code to argparse() code
removing fluff
19h
answered How to upgrade optparse() code to argparse() code
20h
comment Eval scope in Python 2 vs. 3
@Marcin this is not related to the scope of the loop variable leaking outside of list comprehensions. it's about the scope of the loop variable within the comprehension itself.
20h
comment Eval scope in Python 2 vs. 3
The fun part is, moving it out of function scope also stops the problem. related: bugs.python.org/msg81898
20h
comment Python arguments inside triple quotes
make sure to sanitise your input
20h
comment What is the advantage of iteritems?
​➕1 this. time is not correct here
21h
revised Python class scoping rules
deleted 1 character in body
21h
comment Why do we call pitches "low" and "high"?
but the wavelength of a higher pitch is a lower number ... ;)
21h
awarded Autobiographer
21h
awarded Supporter
22h
comment Running exceptions within a function - Python
@wwii it's funny, because the second link you posted (facts and myths) is directly contradicting the first statement you wrote. from ned's article: Myth: Python has no variables. Some people like to say, "Python has no variables, it has names." This slogan is misleading.
1d
comment Convert Python dict to object?
Depending on the use case, usually we would check that it is not a string type but that it is a Sequence type
2d
revised Summing a List in Python Based on the Index of a Loop
added 7 characters in body
Mar
27
comment Escaping unicode strings in python
Perhaps it makes it harder at first, but easier in the long run! If you've ever played unicode whack-a-mole on maintaining [someone else's ;)] old python code .. then you will wish they had the pain upfront, then you wouldn't have to deal with the bugs :) implicit conversions between bytes and unicode was a big mistake IMO
1 2 3 4 5