What is Nostr?
Brett Cannon /
npub1fdq…2uv4
2024-11-02 22:09:15

Brett Cannon on Nostr: While https://snarky.ca/my-proof-of-concept-record-type/ never got enough support, I ...

While https://snarky.ca/my-proof-of-concept-record-type/ never got enough support, I wonder if I leaned into a class-like structure would garner more support?

```
record InventoryItem:
name
price
quantity
```

Add type annotations and it looks like a dataclass. Add in support for * and ** for attributes to control how the `__init__()` would work and then you keep the flexibility of my proposal from my blog w/o the awkward situation of how it looks without a docstring.

Thoughts?
Author Public Key
npub1fdqq95m3f5r5escjzr57v5yggphf7cs4gqgd5ykr882pkx9npussqc2uv4