Skip to content

Fix TypeError in MiddleWordEm extra when options was None (#627) #628

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

Crozzers
Copy link
Contributor

This PR fixes #627, where if the extra options for middle-word-em was set to None it would raise a TypeError.

For extras, it's possible to initialise them without any options like so: extras={'abc': None}. This is usually handled in Extra.__init__ and converted to an empty dictionary, so that the extras don't have to worry about a bunch of runtime type checks:

self.options = options if options is not None else {}

However, middle-word-em would try to set some default options before calling super().__init__, and didn't have sufficient checks for if the value is None. This PR adds a check and converts it to a dict if so

@nicholasserra
Copy link
Collaborator

Thank you!

@nicholasserra nicholasserra merged commit 03d2391 into trentm:master Apr 14, 2025
15 checks passed
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.

How to set extras correctly
2 participants