3 ms·
True story: a few weeks ago, I was trying to debug my Python program, which was reading PubMed XML. It was choking on 'None' as a first name. If you know Pyth
by mcswell 6y ago
True story: a few weeks ago, I was trying to debug my Python program, which was reading PubMed XML. It was choking on 'None' as a first name. If you know Python, you know that it uses the keyword None to represent a null element. Turns out the XML used None where an author didn't have a first name, and the Python library I was using interpreted the string "None" as None rather than the string "None", and this was causing some downstream error where another function was expecting a string. I had to write a special Python function to convert the string "None" into a string (an empty string).