Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Anything after,*, is a kwarg.

A required positional OR kwarg as you’ve done it. Its closer to an optional kwarg if you expand the type declaration to also allow None and set a None default.

But there are times when you want to leave the number and names of kwargs open (one example is for a dynamic wrapper—a function that wraps another function that can be different across invocations.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: