Category Archives: The Hard Way

Tuesday’s Child

John Derbyshire has posted an interesting problem/puzzle, discussed in some detail here. Briefly, the problem is this: A man says: “I have two children. One is a boy born on a Tuesday. What is the probability I have two boys?” … Continue reading

Posted in Python, The Hard Way | Comments Off

Overspecialized Constructors

I want to discuss a simple mistake which recently caused me a disproportionate amount of trouble. I believe I violated a simple rule which might be formulated as “do not create overly specialized constructors in languages which lack constructor overloading“.

Posted in Python, The Hard Way | Comments Off

File-like Strings in Python

Sometimes one has data stored in a string, and wishes to pass that data to a function that expects a file-like object. Writing the data to a file, then opening that file and passing it to the function is cumbersome … Continue reading

Posted in The Hard Way | Comments Off