Good info!
I got caught by number 2 in my previous project, I was trying something like this:
def some_function(some_date = datetime.utcnow()): ...
I'd get the same date everytime some_function was called.
some_function
Changed to something like this:
def some_function(some_date = None): if some_date is None: some_date = datetime.utcnow() ...
Oof, that's a keeper!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good info!
I got caught by number 2 in my previous project, I was trying something like this:
I'd get the same date everytime
some_function
was called.Changed to something like this:
Oof, that's a keeper!