Changeset - 4de5df9035f6
[Not reviewed]
0 2 0
Brett Smith - 3 years ago 2021-02-19 23:54:36
brettcsmith@brettcsmith.org
typing: Upgrade more Posting Iterables to Iterators.
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/cliutil.py
Show inline comments
...
 
@@ -45,2 +45,3 @@ from typing import (
 
    Iterable,
 
    Iterator,
 
    NamedTuple,
...
 
@@ -285,3 +286,3 @@ class SearchTerm(NamedTuple):
 

	
 
    def filter_postings(self, postings: Iterable[data.Posting]) -> Iterable[data.Posting]:
 
    def filter_postings(self, postings: Iterable[data.Posting]) -> Iterator[data.Posting]:
 
        return filters.filter_meta_match(
conservancy_beancount/filters.py
Show inline comments
...
 
@@ -46,3 +46,3 @@ def audit_date(entries: Entries) -> Optional[datetime.date]:
 

	
 
def filter_meta_equal(postings: Postings, key: MetaKey, value: MetaValue) -> Postings:
 
def filter_meta_equal(postings: Postings, key: MetaKey, value: MetaValue) -> Iterator[data.Posting]:
 
    for post in postings:
...
 
@@ -54,3 +54,3 @@ def filter_meta_equal(postings: Postings, key: MetaKey, value: MetaValue) -> Pos
 

	
 
def filter_meta_match(postings: Postings, key: MetaKey, regexp: Regexp) -> Postings:
 
def filter_meta_match(postings: Postings, key: MetaKey, regexp: Regexp) -> Iterator[data.Posting]:
 
    for post in postings:
...
 
@@ -62,3 +62,3 @@ def filter_meta_match(postings: Postings, key: MetaKey, regexp: Regexp) -> Posti
 

	
 
def filter_for_rt_id(postings: Postings, ticket_id: Union[int, str]) -> Postings:
 
def filter_for_rt_id(postings: Postings, ticket_id: Union[int, str]) -> Iterator[data.Posting]:
 
    """Filter postings with a primary RT ticket
0 comments (0 inline, 0 general)