Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recorded_type method of TypeInspector fails on Literal #6

Closed
sg495 opened this issue Jan 6, 2024 · 0 comments
Closed

recorded_type method of TypeInspector fails on Literal #6

sg495 opened this issue Jan 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sg495
Copy link
Contributor

sg495 commented Jan 6, 2024

>>> from typing_validation import can_validate
>>> from typing import Literal
>>> v = can_validate(Literal[0, 1])
>>> v
The following type can be validated against:
Literal[0, 1]
>>> v.recorded_type
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Stefa\Documents\git\hashberg-io\typing-validation\typing_validation\validation.py", line 143, in recorded_type
    t, idx = self._recorded_type(0)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Stefa\Documents\git\hashberg-io\typing-validation\typing_validation\validation.py", line 166, in _recorded_type
    return Literal.__getitem__(Literal, *param), idx # pylint: disable = unnecessary-dunder-call
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _LiteralSpecialForm.__getitem__() takes 2 positional arguments but 4 were given
@sg495 sg495 added the bug Something isn't working label Jan 6, 2024
@sg495 sg495 closed this as completed in ca3fb91 Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant