Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.



Table of Contents

  • Type Systems
    • Dynamic Typing
    • Static Typing
    • Duck Typing
  • Hello Types
  • Pros and Cons
  • Annotations
    • Function Annotations
    • Variable Annotations
    • Type Comments
    • So, Type Annotations or Type Comments?
  • Playing With Python Types, Part 1
    • Example: A Deck of Cards
    • Sequences and Mappings
    • Type Aliases
    • Functions Without Return Values
    • Example: Play Some Cards
    • The Any Type
  • Type Theory
    • Subtypes
    • Covariant, Contravariant, and Invariant
    • Gradual Typing and Consistent Types
  • Playing With Python Types, Part 2
    • Type Variables
    • Duck Types and Protocols
    • The Optional Type
    • Example: The Object(ive) of the Game
    • Type Hints for Methods
    • Classes as Types
    • Returning self or cls
    • Annotating *args and **kwargs
    • Callables
    • Example: Hearts
  • Static Type Checking
    • The Mypy Project
    • Running Mypy
    • Adding Stubs
    • Typeshed
    • Other Static Type Checkers
    • Using Types at Runtime
  • Conclusion

Recommended Video Course
Python Type Checking

Learn Python
  • Start Here
  • Learning Resources
  • Code Mentor
  • Python Reference
  • Support Center
Courses & Paths
  • Learning Paths
  • Quizzes & Exercises
  • Browse Topics
  • Workshops
  • Books
Community
  • Podcast
  • Newsletter
  • Community Chat
  • Office Hours
  • Learner Stories
Membership
  • Plans & Pricing
  • Team Plans
  • For Business
  • For Schools
  • Reviews
Company
  • About Us
  • Team
  • Sponsorships
  • Careers
  • Press Kit
  • Merch
Privacy Policy ⋅ Terms of Use ⋅ Security ⋅ Contact
Happy Pythoning!
© 2012–2025 DevCademy Media Inc. DBA Real Python. All rights reserved.
REALPYTHON™ is a trademark of DevCademy Media Inc.
Real Python - Online Python Training (logo)