anikolaienko / py-automapper

Python object auto mapper
https://anikolaienko.github.io/py-automapper/
MIT License
56 stars 10 forks source link

Subscriptable check #13

Closed g-pichler closed 1 year ago

g-pichler commented 1 year ago

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__)?

anikolaienko commented 1 year ago

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!

anikolaienko commented 1 year ago

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