You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2026. It is now read-only.
While I was fiddling around with scrapbook, I ended up writing a dataclass for scrap.Scrap items.
I noticed in the source that you have a comment that says:
# dataclasses would be nice here...Scrap=namedtuple("Scrap", ["name", "data", "encoder", "display"])
Scrap.__new__.__defaults__= (None,)
So I figured you could be interested by the implementation I made! :)
See below:
Hey there!
While I was fiddling around with scrapbook, I ended up writing a dataclass for scrap.Scrap items.
I noticed in the source that you have a comment that says:
So I figured you could be interested by the implementation I made! :)
See below:
keys,__getitem__,__len__are for the Mapping protocol, to allow the Scrap to be converted to a dict using the**operator ({**scrap})__iter__is to support unpacking the scrapasdict,astupleare for convenience