Subscriptable check
Closed this issue · 2 comments
Reading through the code I spotted the following line 42 in automapper/mapper.py
:
return hasattr(obj, "__get_item__")
Is this on purpose, or should it read
return hasattr(obj, "__getitem__")
(__getitem__
instead of __get_item__
)?
Wow, that is lack of CI and testing. I'll try to setup some Github CI and add tests for this case. Thank you for noticing!
Fixed and published new version: https://pypi.org/project/py-automapper/
Here is the test case for this scenario: https://github.com/anikolaienko/py-automapper/blob/main/tests/test_subscriptable_obj_mapping.py
Appreciate for noticing it!
I also added CI checks now and initial contribution guide:
https://github.com/anikolaienko/py-automapper/blob/main/CONTRIBUTING.md