FelixTheC / strongtyping

Decorator which checks whether the function is called with the correct type of parameters.
https://pypi.org/project/strongtyping/
107 stars 3 forks source link

RecursionError #105

Closed alexmarco closed 1 year ago

alexmarco commented 1 year ago

Describe the bug When try to check this code:

from strongtyping.strong_typing import match_class_typing
import dataclasses as dc
import typing as t

@match_class_typing
@dc.dataclass
class QueryPipelineFunctions:
    """"""
    callables: t.List[str]

QueryPipelineFunctions(["a", "b"])

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\.virtualenvs\arqdat\lib\site-packages\strongtyping\strong_typing.py", line 54, in inner
    cached_key = (func, args.__str__(), kwargs.__str__())
  File "C:\Users\arqdat\lib\site-packages\strongtyping\strong_typing.py", line 54, in inner
    cached_key = (func, args.__str__(), kwargs.__str__())
  File "C:\Users\arqdat\lib\site-packages\strongtyping\strong_typing.py", line 54, in inner
    cached_key = (func, args.__str__(), kwargs.__str__())
  [Previous line repeated 329 more times]
  File "C:\Users\arqdat\lib\site-packages\strongtyping\strong_typing.py", line 49, in inner
    if arg_names and severity_level > SEVERITY_LEVEL.DISABLED.value:
RecursionError: maximum recursion depth exceeded while calling a Python object

Python Version used Python 3.8.8

Package Version used strongtyping 2.2.2

Addon in use strongtyping_modules [no]

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior Expect that no error is found

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

FelixTheC commented 1 year ago

new release 2.2.3 should fix this error