Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhozic committed Jan 28, 2024
1 parent ef1063a commit 77f3dbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Glossary
Releases
---------------------

v1.4.3
================
- Fixed an error when a subclass's generic accepts less types than the original


v1.4.2
================
- Fixed issue with typing conversion.
Expand Down
2 changes: 1 addition & 1 deletion tkclasswiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SOFTWARE.
"""

__version__ = "1.4.2"
__version__ = "1.4.3"


from .object_frame import *
Expand Down
4 changes: 3 additions & 1 deletion tkclasswiz/object_frame/frame_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ def remove_classes(types: list):
# Process abstract classes and polymorphism
new_origins = []
for origin in cls.convert_types(origin):
if issubclass_noexcept(origin, (Generic, Iterable)):
if issubclass_noexcept(origin, Iterable):
new_origins.append(origin[tuple(new_types)])
elif issubclass_noexcept(origin, Generic):
new_origins.append(origin[tuple(new_types[:len(origin.__parameters__)])])
else:
new_origins.append(origin)

Expand Down

0 comments on commit 77f3dbc

Please sign in to comment.