Skip to content

An introduction to Python 3 type annotations, using lots of simple, hackable examples

Notifications You must be signed in to change notification settings

pluralsight/intro-to-python-typing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro to Python Typing

A practical introduction to Python's type annotation features (and the typing module), via simple, hackable examples.

(The examples currently use the typing syntax introduced in Python 3.6 - Backwards-compatible Python 2 examples may be added in a future update.)

These examples are intended to be self-explanatory to a Python developer, with minimal setup.

In addition to Python 3.6+, you'll also need the mypy type validator installed to experiment with the provided code:

pip install mypy

(optionally, inside a virtualenv or other environment wrapper, to keep this from affecting your local Python libraries!)

Once you've got all the requirements in place, you should be able to simply run

mypy examples/

In the base folder, and see a confirmation message like Success: no issues found in 18 source files.

You can now begin the tutorial track here:

Tutorial 1: Core Types

(There are currently 16 examples, but only a few have detailed tutorials at the moment - I hope to improve this in the near future!)


If you have any feedback, questions, or Typing features you'd like to see covered, please let me know on Pluralsight Slack as @david.sturgis, or via GitHub Issues (or a PR) on this repo. Thanks!

About

An introduction to Python 3 type annotations, using lots of simple, hackable examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published