Numbers and core type fixes by DenverCoder1 · Pull Request #966 · python-babel/babel

Type annotation improvements:

  1. Changed Locale.parse to always return a Locale (this fixes type issues in multiple places where the return type is assumed to not be None)
  2. Fixed Pyright type errors and added type: ignore in 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