File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ class has `pyfields` fields and does not define an `__init__` method ; and `Fals
205205 raise ValueError ("`autoeq` can not be set to `True` simultaneously with `autodict`. Please set "
206206 "`autodict=False`." )
207207 # By default execute with the known list of fields, so equivalent of `only_known_fields=True`.
208- execute_autodict_on_class (cls , selected_names = selected_names )
208+ # Exclude private fields by default to have a consistent behaviour with autodict
209+ public_names = tuple (n for n in selected_names if not n .startswith ('_' ))
210+ execute_autodict_on_class (cls , selected_names = public_names )
209211 else :
210212 if autorepr is AUTO or autorepr :
211213 # By default execute with the known list of fields, so equivalent of `only_known_fields=True`.
You can’t perform that action at this time.
0 commit comments