Dr. jonny phd on Nostr: In Python, *kwargs in a function signature is passed as a dictionary within the ...
In Python, *kwargs in a function signature is passed as a dictionary within the function. you do *not need a MATLAB style argument unpacking function, you can in fact just go kwargs['key']. let the cold clammy ghosts of MATLAB fade away, we don't need them here anymore.
you do not need to check if the dictionary contains the key and raise an error if it doesn't. KeyError is already explicitly that. again MATLAB is not here anymore, we're using a language where they actually work on the error messages.
Published at
2023-08-12 04:00:31Event JSON
{
"id": "069577ca02418b47c4df90726ed7665714fe0c6f8526608393b90cb2879d09f0",
"pubkey": "9926f6c53162329fcb33481f0c5db4a015bdd63d564636ea13c35d4975c176e3",
"created_at": 1691812831,
"kind": 1,
"tags": [
[
"e",
"d345f09080a33696735339e2b4d05a097b122fb2b2fb02d9fd7417d30c340a16",
"wss://relay.mostr.pub",
"reply"
],
[
"content-warning",
"python/matlab cursed neuroscientist-programmer hell"
],
[
"proxy",
"https://neuromatch.social/users/jonny/statuses/110874645749424762",
"activitypub"
]
],
"content": "In Python, *kwargs in a function signature is passed as a dictionary within the function. you do *not need a MATLAB style argument unpacking function, you can in fact just go kwargs['key']. let the cold clammy ghosts of MATLAB fade away, we don't need them here anymore. \n\nyou do not need to check if the dictionary contains the key and raise an error if it doesn't. KeyError is already explicitly that. again MATLAB is not here anymore, we're using a language where they actually work on the error messages.",
"sig": "7b0333283c9c56f5f7b77eb9d3a76892dca07e6f93830992d348fc5d9ee0923bf36a3959fe9fc5bf77d4d6b500efad8d221af94d6b69184bebf22d36562868d8"
}