Numbers and core type fixes by DenverCoder1 · Pull Request #966 · python-babel/babel
Type annotation improvements:
- Changed
Locale.parseto always return aLocale(this fixes type issues in multiple places where the return type is assumed to not be None) - Fixed Pyright type errors and added
type: ignorein certain places in core.py and numbers.py
Note: Changing Locale.parse to always return a Locale simplifies the logic, but it also can potentially be a breaking change if people are relying on passing None not raising an exception. It is a bit of a stretch though, since passing None has no functional effect in the use of the lib.
These changes have been separated from #961