Skip to content

Automatic partials? #5

Description

@mvirts

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions