Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove default tags list from Event class. #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ nostr.egg-info/
dist/
nostr/_version.py
.DS_Store
.python-version
4 changes: 2 additions & 2 deletions nostr/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
content: str,
created_at: int = None,
kind: int=EventKind.TEXT_NOTE,
tags: "list[list[str]]"=[],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is better done with default_factory see: #84

tags: "list[list[str]]" = None,
id: str=None,
signature: str=None) -> None:
if not isinstance(content, str):
Expand All @@ -33,7 +33,7 @@ def __init__(
self.content = content
self.created_at = created_at or int(time.time())
self.kind = kind
self.tags = tags
self.tags = tags or []
self.signature = signature
self.id = id or Event.compute_id(self.public_key, self.created_at, self.kind, self.tags, self.content)

Expand Down