Return a sequence of all dataclasses.Field objects associated with an already processed dataclass, excluding those that originate from a superclass. The class must **already be a dataclass** for Field objects to be returned.
(cls: Type[Any])
| 271 | |
| 272 | |
| 273 | def local_dataclass_fields(cls: Type[Any]) -> Iterable[dataclasses.Field[Any]]: |
| 274 | """Return a sequence of all dataclasses.Field objects associated with |
| 275 | an already processed dataclass, excluding those that originate from a |
| 276 | superclass. |
| 277 | |
| 278 | The class must **already be a dataclass** for Field objects to be returned. |
| 279 | |
| 280 | """ |
| 281 | |
| 282 | if dataclasses.is_dataclass(cls): |
| 283 | super_fields: Set[dataclasses.Field[Any]] = set() |
| 284 | for sup in cls.__bases__: |
| 285 | super_fields.update(dataclass_fields(sup)) |
| 286 | return [f for f in dataclasses.fields(cls) if f not in super_fields] |
| 287 | else: |
| 288 | return [] |
| 289 | |
| 290 | |
| 291 | if freethreading: |
nothing calls this directly
no test coverage detected