Skip to content

Commit

Permalink
Make sure type checking fails decorating non abstract class (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
Petter Friberg authored Sep 17, 2022
1 parent 0dcbf2f commit 1444240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abcattrs/abcattrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def get_abstract_attributes(cls: type) -> Iterable[tuple[str, type]]:
yield var, annotated


C = TypeVar("C")
C = TypeVar("C", bound=type[abc.ABC])


def abstractattrs(cls: C) -> C:
attributes = get_abstract_attributes(cls) # type: ignore[arg-type]
attributes = get_abstract_attributes(cls)

# Save metadata about the abstract attributes on the decorated class. By merging
# with any already defined attributes we support multiple decorations and
Expand Down

0 comments on commit 1444240

Please sign in to comment.