Skip to content

Commit

Permalink
skip attrs for built-in types
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed May 18, 2023
1 parent ca76e7c commit 6ca2f71
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions attmap/attmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ def _metamorph_maplike(self, m):
)
to_return = self._lower_type_bound(m.items())

# Don't forget any attributes included in this item
for attr in dir(m):
if attr in m.items():
continue
if attr[:1] == "_":
continue
to_return.__setattr__(attr, m.__getattribute__(attr))
# Don't forget any attributes included in this item, for non-builtin items
if (
m.__class__.__module__ != "builtins"
and m.__class__.__module__ != "collections"
):
print(f"Class:{m.__class__.__module__}")
for attr in dir(m):
if attr in m.items():
continue
if attr[:1] == "_":
continue
to_return.__setattr__(attr, m.__getattribute__(attr))

return to_return






def _new_empty_basic_map(self):
"""Return the empty collection builder for Mapping type simplification."""
return dict()
Expand Down

0 comments on commit 6ca2f71

Please sign in to comment.