Skip to content

Conversation

@goodmami
Copy link
Owner

Some long delayed and other opportunistic code cleanup.

Unfortunately we still need these fallbacks for Mypy to be happy
because `bool` is not the same as `Literal[True] | Literal[False]`,
so something like `Synset.relations(data=(1==2))` would not match
one of the literal overloads.
- `|` for typing unions and optionals
- dataclass `slots=True`
- non-string type aliases
- explicit TypeAlias
- 'match' statement pattern matching
- remove docs for removed ili functions
- remove extra index entry for wn.compat.sensekey
- fix up the docstring for wn.add()
This wasn't really a namespace package, so it should probably have an
__init__.py file, even if worked without it.
- `C4` comprehensions
- `LOG` logging
- `SIM` simplifications
- `UP` updating to newer python features
This required a few `# type: ignore` comments where ty and mypy don't
agree or can't correctly infer the type, but for now both type checkers
are relatively happy.
@goodmami goodmami merged commit 2ecf3f2 into main Jan 16, 2026
14 checks passed
@goodmami goodmami deleted the misc-fixes branch January 16, 2026 05:23
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