-
Fork this project if you haven't done so
-
Determine how difficult the challenge is. There are 4 levels: basic, intermediate, advanced, and extreme.
-
Create a new directory under
challenges/
. The new directory's name should follow the pattern[basic|intermediate|advanced|extreme]-name
.For example, say you want to add a new challenge about Protocols. Since this is an advanced topic, you may name the directory
advanced-protocol
. -
Put a
question.py
and asolution.py
in the new directory. Here's an examplequestion.py
:""" TODO: foo should accept a dict argument, both keys and values are string. """ def foo(x): pass ## End of your code ## foo({"foo": "bar"}) foo({"foo": 1}) # expect-type-error
You want to include several things in
question.py
:- Describe the challenge, make sure people understand what they need to accomplish (i.e. the
TODO:
part) - A comment
## End of your code ##
. This is mandatory, just copy and paste it. - Several test cases. Add a comment
# expect-type-error
after the lines where type errors should be thrown.
solution.py
contains the right solution, with everything else unchanged. - Describe the challenge, make sure people understand what they need to accomplish (i.e. the
-
Test with
pyright
to make sure your new challenge works as expected. -
Create a Pull Request.