Commit 9ca29f3
Remove default values from class-level list annotations
Using = [] on class-level attributes creates a single shared list
instance across all HumanName instances. Any direct mutation (e.g.
hn.first_list.append(...)) on an instance created without a full_name
would corrupt the default for all subsequent instances. Both code paths
in __init__ (parse_full_name and the per-attribute setters) always
initialize these as instance-level lists, so the class-level defaults
were never needed — only the type annotations are.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b3efc25 commit 9ca29f3
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
0 commit comments