Al Sweigart on Nostr: Python question: I am writing MyLibrary which has a container MyClass. Should the ...
Python question: I am writing MyLibrary which has a container MyClass. Should the __getitem__() method for MyClass raise KeyError or my own custom MyLibraryKeyError?
Published at
2024-11-12 15:01:59Event JSON
{
"id": "75b4d822f830cdaa4b7311a87e1c0b04215b51962e636a93ec670d94a1efa7a9",
"pubkey": "e6209258574b94ca26c7fd92f570c052fc5ee0ac1a302d98fcac5d8407d49eaa",
"created_at": 1731423719,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@AlSweigart/113470584902075320",
"web"
],
[
"proxy",
"https://mastodon.social/users/AlSweigart/statuses/113470584902075320",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/AlSweigart/statuses/113470584902075320",
"pink.momostr"
],
[
"-"
]
],
"content": "Python question: I am writing MyLibrary which has a container MyClass. Should the __getitem__() method for MyClass raise KeyError or my own custom MyLibraryKeyError?",
"sig": "d8c23d6c6afb694dd266c76851b2a16e455e8724af3b812647294a3012bc110e85156a4c3fe2f2345a6cd1d123a33ceb44b91bc6778c7a818187744fabc09f63"
}