strptime for different languages
Tobiah
toby at tobiah.org
Wed Dec 18 14:27:25 EST 2019
> A couple of point about your code:
>
> 1. Don't use a bare 'except' because it'll catch _any_ exception. See
> what exception strptime will raise and catch only that.
I'm well aware of this, but I was too lazy to write something
to generate the exception to find out what datetime would throw
in this case. It crossed my mind when posting, but I was illustrating
an idea rather than submitting usable code.
> 2. Why use 'continue' instead of 'pass'?
No reason. Does one have a benefit over the other?
Tobiah
More information about the Python-list
mailing list