Tutorial document
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 302
- Avg merge
- 23h
- Merged PRs (30d)
- 8
Description
Thoughts on the tutorial document.
Basic Topics
- Set up a basic venv with a pinned mypy version. (For compatibility reasons.) Should add a note about using a current version in production.
- Annotating variables.
- Annotating functions and methods.
- Unions, using
| None Anycast()and# type: ignore- Using generics, variance
- Built-in collections
- Type aliases
int/floatNoReturn(not strictly necessary, but a fairly easy topic)- Installing third-party stubs
Advanced Topics
The are fairly complicated topics, but basically required when typing a non-trivial code base:
Callable- Writing generics
- Protocols
type[...]typing.TYPE_CHECKINGand circular importsTypeVarandAnyStr- overloads
Literal
What not to include
# typeannotations (except# type: ignore)
The following topics could arguably be included, but for simplicity's sake, I'd suggest to skip them in this basic tutorial:
NewTypeClassVarFinalAnnotatedNamedTupleTypedDict
Other Thoughts
- We can use a newer version of Python (e.g. 3.8+) for simplicity and add a note that not all features are available in older Python versions.
- We should probably just use
from __future__ import annotationsand skip the whole forward references/quoting types problem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No tutorial file, entry point, or test is named in the issue. Start by locating the existing tutorial documentation and compare it with the proposed basic and advanced topic lists. Done means agreeing on the tutorial scope, Python version guidance, included typing topics, and exclusions, then documenting those decisions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100