konradhalas / dacite

Simple creation of data classes from dictionaries.
MIT License
1.72k stars 106 forks source link

If a property is a python name also search for it with _ #204

Open JCHacking opened 1 year ago

JCHacking commented 1 year ago

It would be nice to add the following enhancement:

According to PEP8 (https://peps.python.org/pep-0008/#descriptive-naming-styles) when a name causes a conflict with a python reserved word the convention is to add _

Example: id --> Already exists in python id_ --> This is how I call my property so that there is no conflict.

JCHacking commented 11 months ago

Hi @konradhalas I have added a pull request with this functionality, tell me what you think!!!