Skip to content

Conversation

@vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented May 10, 2018

I was just puzzled for some seconds by the code:

if event_name not in self._event_handlers:
    self._event_handlers[event_name] = []

and thus for ease of understanding it could be replaced by defaultdict.
This PR is really a code polishing, so if there are some objections, we can easily close it.
What do you guys think ?

@alykhantejani
Copy link
Contributor

LGTM, not sure why I didn't use a defaultdict in the first place.

@vfdev-5 vfdev-5 merged commit e5e0ae0 into pytorch:master May 10, 2018
@vfdev-5 vfdev-5 deleted the event_handlers branch May 10, 2018 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants