Closed lucasrcezimbra closed 11 months ago
Issue number of the reported bug or feature request: no related issue.
Describe your changes The validator was not supporting types without args. For example:
>>> from unittest.mock import MagicMock >>> from attrs_strict import type_validator >>> >>> attr = MagicMock() >>> attr.name = "zoo" >>> attr.type = list >>> >>> type_validator()(None, attr, [1, 2, 3]) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ... AttributeError: type object 'list' has no attribute '__args__'
This PR fixes it for lists, dicts, and tuples.
Testing performed Written tests.
@lucasrcezimbra can you run pre-commit to fix the linting issues?
Issue number of the reported bug or feature request: no related issue.
Describe your changes The validator was not supporting types without args. For example:
This PR fixes it for lists, dicts, and tuples.
Testing performed Written tests.