Comments (1)
I guess the indentation is causing the issue(in the original file). The mypy is in strict mode which uses user
as variable User
and the line new_user: Optional[User] = User.get_user(name="Guido")
use variable as Optional[User]
. This causes the mypy to raise error.
There is no issue with the your code, can you align the code like this and try?
def main() -> None:
. ..
# Same level as main
user: Optional[User] = User.get_user(name="Guido")
from python-typing-koans.
Related Issues (9)
- 117-easy-protocol-across-objects discussion HOT 1
- 114-medium-factory-pattern HOT 4
- Consider adding `django-stubs` and `drf-stubs` plugins! HOT 1
- `dry-python` koans: `returns` and `classes` HOT 1
- 112-medium-type-as-example discussion HOT 1
- undenfined name in exercise 110 HOT 1
- Python Typing Koans: Solutions HOT 2
- 103-easy-mixed-values discussion HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-typing-koans.