Refactor metaclass logic a bit, ensure lambdas are excluded

This commit is contained in:
Joe Farebrother
2025-02-07 21:46:30 +00:00
parent 287cf0121d
commit 61d5a692fb
4 changed files with 31 additions and 34 deletions

View File

@@ -141,3 +141,10 @@ class SpecialMethodNames(object):
def __class_getitem__(cls):
pass
from dataclasses import dataclass, field
@dataclass
class A:
# Lambdas used in initilisation aren't methods.
x: int = field(default_factory = lambda: 2)