Document known typecheck failures.
This commit is contained in:
parent
1caeb9a1a6
commit
661fe676e1
2 changed files with 5 additions and 3 deletions
|
@ -95,7 +95,7 @@ class Posting(BasePosting):
|
||||||
# of Beancount's type declaration being a smidge too specific: I think it
|
# of Beancount's type declaration being a smidge too specific: I think it
|
||||||
# would be very unusual for code to actually require a dict over a more
|
# would be very unusual for code to actually require a dict over a more
|
||||||
# generic mapping. If it did, this would work fine.
|
# generic mapping. If it did, this would work fine.
|
||||||
meta: MutableMapping[MetaKey, MetaValue]
|
meta: MutableMapping[MetaKey, MetaValue] # type:ignore[assignment]
|
||||||
|
|
||||||
|
|
||||||
def iter_postings(txn: Transaction) -> Iterator[Posting]:
|
def iter_postings(txn: Transaction) -> Iterator[Posting]:
|
||||||
|
@ -103,5 +103,6 @@ def iter_postings(txn: Transaction) -> Iterator[Posting]:
|
||||||
yield Posting(
|
yield Posting(
|
||||||
Account(source.account),
|
Account(source.account),
|
||||||
*source[1:5],
|
*source[1:5],
|
||||||
PostingMeta(txn, index, source),
|
# see rationale above about Posting.meta
|
||||||
|
PostingMeta(txn, index, source), # type:ignore[arg-type]
|
||||||
)
|
)
|
||||||
|
|
|
@ -56,7 +56,8 @@ class HookRegistry:
|
||||||
self.group_name_map.setdefault(key, set()).add(hook_cls)
|
self.group_name_map.setdefault(key, set()).add(hook_cls)
|
||||||
return hook_cls # to allow use as a decorator
|
return hook_cls # to allow use as a decorator
|
||||||
|
|
||||||
def import_hooks(self, mod_name, *hook_names, package=__module__):
|
# This method is too dynamic to typecheck.
|
||||||
|
def import_hooks(self, mod_name, *hook_names, package=__module__): # type:ignore
|
||||||
module = importlib.import_module(mod_name, package)
|
module = importlib.import_module(mod_name, package)
|
||||||
for hook_name in hook_names:
|
for hook_name in hook_names:
|
||||||
self.add_hook(getattr(module, hook_name))
|
self.add_hook(getattr(module, hook_name))
|
||||||
|
|
Loading…
Reference in a new issue