Commit 6f0982b
committed
Add classes_and_objects_exercise1.py: demonstrate mypy type checking
- Create Person class with type-annotated __init__ method
- Add name (str), age (int), and preferred_operating_system (str) attributes
- Create example instances (imran and eliza)
- Intentionally access undefined 'address' attribute to demonstrate mypy error detection
- Document the mypy error and explain the missing attribute issue1 parent 1aca968 commit 6f0982b
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments