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
Make calls that are missing args into partials? Create a new singleton sentinel NoArg to signify a missing arg to a partial. If you can create "NoArg", then you can make args that have no default always default to NoArg.
a = print(NoArg,end="\n\n-said the cat\n")
a("Meow. Feed Me.")
#Meow. Feed Me.
#
#-said the cat
def b(animal,sound):
print(f"{animal} goes {sound}")
c = b("Cat")
c("Meow")
#Cat goes Meow
c("Purr")
#Cat goes Purr
The text was updated successfully, but these errors were encountered:
Could this feature be called "Automatic currying" instead? I feel like calling them partials could be a bit confusing because of the mathematical interpretation of partial functions.
Make calls that are missing args into partials? Create a new singleton sentinel NoArg to signify a missing arg to a partial. If you can create "NoArg", then you can make args that have no default always default to NoArg.
The text was updated successfully, but these errors were encountered: