-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
Inspired by @kelvinburke's odict_custom, would be nice to have a function that creates a new object that automatically applies a function on set. For example:
obj = dict(a=12, b=34)
strdict = sc.autoapply(obj, func=str)
strdict['c'] = 56
print(strdict['a']) # gives '12'
print(strdict['c']) # gives '56'Not sure if this is possible in the general case, but would be cool if it were! Related to sc.asobj().
Reactions are currently unavailable