3 | | Django's pattern of calling `hasattr(obj, "natural_key")` is not subclass-friendly as pointed out above. There needs to be some way to ''cancel'' natural key serialization in a subclass and check for that. Maybe `def natural_key() -> tuple[str]` becomes `def natural_key() => tuple[str] | None`, and `hasattr(obj, "natural_key")` becomes some friendly wrapper for `getattr(obj, "natural_key", lambda: None)() is not None`? |
| 3 | Django's pattern of calling `hasattr(obj, "natural_key")` is not subclass-friendly as pointed out above. There needs to be some way to ''cancel'' natural key serialization in a subclass and check for that. Maybe `def natural_key() -> tuple[str]` becomes `def natural_key() => tuple[str] | None`, and `hasattr(obj, "natural_key")` becomes some friendly wrapper for `getattr(obj, "natural_key", lambda obj: None)(obj) is not None`? |