David Beazley on Nostr: Current annoyance: >>> @dataclass ... class Point: ... x : int ... y : int ... >>> p ...
Current annoyance:
>>> @dataclass
... class Point:
... x : int
... y : int
...
>>> p = Point("two", "three")
>>> match p:
... case Point(x):
... print("Yep:", x)
...
Yep: two
>>>
Actually, there are multiple annoyances.
Published at
2024-03-15 12:56:13Event JSON
{
"id": "68c9bd89cd04eb91b694ce428c90ca05e036c519d198f33eb8cdfb1362b0c3f2",
"pubkey": "54be8b44da6d3e62d80831e30a85ef15645e1fb05fcadcf16709f5bb2a350112",
"created_at": 1710507373,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/dabeaz/statuses/112099811236039382",
"activitypub"
]
],
"content": "Current annoyance:\n\n\u003e\u003e\u003e @dataclass\n... class Point:\n... x : int\n... y : int\n...\n\u003e\u003e\u003e p = Point(\"two\", \"three\")\n\u003e\u003e\u003e match p:\n... case Point(x):\n... print(\"Yep:\", x)\n...\nYep: two\n\u003e\u003e\u003e\n\nActually, there are multiple annoyances.",
"sig": "071ebaf92b9736dfa0eb05ccab8ce6bc7ed3e81e07821d902745ba1b024abbead17cf7c847b6cb3b60b5e2ad360e60c4c6cfafc7fe2ce1d8434f5fc16600fd81"
}