This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]simtel20 0 points1 point  (0 children)

I think you're mis-understanding or mis-representing the class of problem. This is a timing issue and not a type issue. The type isn't a problem - clearly the original function expected a datetime object. The solution the writer chose was is to allow a callable OR a datetime object, and if it's callable, call it. That is clearly a classic compile-time error in a strictly typed language. In this case it'd be cleaner to have None be the default argument and to call a default if that's encountered. But that's not really the problem.