Paul Everitt on Nostr: Hey Python typing folks. Let's say I have a dataclass with a field called target. The ...
Hey Python typing folks. Let's say I have a dataclass with a field called target. The value is a typing.Protocol…not an object that matches the Protocol, but the protocol itself.
What's the type hint? (If you say typing._ProtocolMeta then you have some ‘splaining to do.)
Published at
2024-08-31 14:03:52Event JSON
{
"id": "693a396280c438741e5942a45926389eced59b71fd02527d0d85806f9bf33be6",
"pubkey": "09ffffb1185590474aea2a7474e4d3ff33f1d5aa4d252e807cd44d6b4b8c068a",
"created_at": 1725113032,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/@pauleveritt/113057007678457840",
"web"
],
[
"proxy",
"https://fosstodon.org/users/pauleveritt/statuses/113057007678457840",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/pauleveritt/statuses/113057007678457840",
"pink.momostr"
],
[
"-"
]
],
"content": "Hey Python typing folks. Let's say I have a dataclass with a field called target. The value is a typing.Protocol…not an object that matches the Protocol, but the protocol itself.\n\nWhat's the type hint? (If you say typing._ProtocolMeta then you have some ‘splaining to do.)",
"sig": "5ba4c82149b85c711a04a46b6760b9a31c385138d711d66023090e93343aa2f9927ac04eeb86fedda1a5e6e5a8fe1db211557277b285cd2ac904cb705f8f2b85"
}