fix(en_IN, es_MX, zh_CN): inherit en_GB bank provider so GB iban() is valid - #2413
fix(en_IN, es_MX, zh_CN): inherit en_GB bank provider so GB iban() is valid#2413CedricConday wants to merge 2 commits into
Conversation
…cales type-check en_IN, es_MX and zh_CN now inherit en_GB.Provider; en_GB's untyped 'banks' tuple was inferred as fixed-length, making those subclasses' differing bank lists fail mypy as incompatible overrides. Annotating the base as Tuple[str, ...] resolves it.
|
these shouldn't inherit from en_GB, but from a more abstract BankIBAN provider. Also, if they don't support IBAn (like China and Mexico), the |
|
The three locales in this PR already emit GB IBANs today — the base provider defaults The same holds for Happy to add the abstract IBAN provider and have non-IBAN locales raise, but that breaks |
These locales fall back to GB IBANs but lacked a correct bank provider, producing invalid IBANs. They now inherit the en_GB bank provider.
Verified against
python-stdnum(reference IBAN validator): 300/300 generated IBANs passstdnum.iban.validate(). Existingtests/providers/test_bank.pysuite passes. Includes a regression test.AI disclosure: Prepared with AI assistance (Claude / Claude Code). All output was human-reviewed and verified — generated IBANs validated against
python-stdnumand the test suite passes.