-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Event default created_at time #23
Comments
Hi @armstrys, the Event class sets the If I correctly understand what you are trying to do, you can do something like this: curr_time = time.time()
event = Event(public_key, "this is a test", created_at=curr_time)
assert event.created_at == curr_time |
Hi @jeffthibault! What I am noticing on my machine is that the default value is being set as soon as the module is imported as opposed to when an Basically the default time isn’t being recalculated for each event properly. If I’m seeing this wrong then I agree it would make more sense to keep it defined as the arg default. |
@armstrys I agree with you. Didn't realize you had opened a PR so I did, but have since deleted it. I think the problem lies in that the default args are determined on import, not initialization. |
Fixed in #24 |
The default value for created_at in the
Event
class seems to hold thetime.time()
value from the time of import.Example of a failing test below:
The text was updated successfully, but these errors were encountered: