Duck Typing
Type Hinting
- Python is dynamically typed language
-
Type hinting improves
- readability
- IDE to give better suggestions
- frameworks like FastAPI, Pydantic rely on this
-
Prompt:
You are an expert in Python
I'm trying to learn python.
Give me possibilites of using type hinting
Explain each possibility with a simple example and stop for me to understand
Then go th next possibility
- Exercise:
- In python how do i know if my object is derived from specific class programmatically
- How to i know programatically if the object has a member called as
valueand method called as walk
