data: Specify the type of Posting.cost.

The rationale is the same as it was for Posting.amount.
This commit is contained in:
Brett Smith 2020-05-27 22:07:42 -04:00
parent 8f014df515
commit 52fa66bba1

View file

@ -27,6 +27,7 @@ import functools
from beancount.core import account as bc_account from beancount.core import account as bc_account
from beancount.core import amount as bc_amount from beancount.core import amount as bc_amount
from beancount.core import convert as bc_convert from beancount.core import convert as bc_convert
from beancount.core import position as bc_position
from typing import ( from typing import (
cast, cast,
@ -269,6 +270,7 @@ class Posting(BasePosting):
account: Account account: Account
units: Amount units: Amount
cost: Optional[bc_position.Cost]
# mypy correctly complains that our MutableMapping is not compatible # mypy correctly complains that our MutableMapping is not compatible
# with Beancount's meta type declaration of Optional[Dict]. IMO # with Beancount's meta type declaration of Optional[Dict]. IMO
# Beancount's type declaration is a smidge too specific: I think its type # Beancount's type declaration is a smidge too specific: I think its type