We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c94fb3a commit 825fe1aCopy full SHA for 825fe1a
python-copy/person.py
@@ -55,9 +55,8 @@ def __replace__(self, **changes):
55
person = Person("John Doe", 42)
56
person_copy = copy.replace(person, age=24, name="Alice Smith")
57
58
- vars_slots = lambda obj: {
59
- name: getattr(obj, name) for name in obj.__slots__
60
- }
+ def vars_slots(obj):
+ return {name: getattr(obj, name) for name in obj.__slots__}
61
62
print(vars_slots(person))
63
print(vars_slots(person_copy))
0 commit comments