python-nostr
python-nostr copied to clipboard
Initializing a dict in an argument.
In class Relay init:
class Relay:
def __init__(
self,
url: str,
policy: RelayPolicy,
message_pool: MessagePool,
subscriptions: dict[str, Subscription]={}) -> None:
You are initializing subscriptions to a dict '{}' is this correct?
"the default value for a function argument is only evaluated once, at the time that the function is defined. "
All self.subscriptions will "share" a common dictionary right?
ops....This is duplicated of #51