We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 208e0a0 commit 12bfe00Copy full SHA for 12bfe00
docs/source/command_line.rst
@@ -503,8 +503,21 @@ potentially problematic or redundant in some way.
503
being instantiated which has attributes that were declared but never
504
initialized.
505
506
- (TODO: give examples)
+ For example, in the following code, mypy will warn that ``value`` was not
507
+ initialized.
508
+
509
+ .. code-block:: python
510
511
+ class Foo:
512
+ value: int
513
+ def __init__(self) -> None:
514
+ self.vaelu = 3 # typo in variable name
515
+ foo = Foo() # Error: 'value' is uninitialized
516
517
+ .. note::
518
519
+ Mypy cannot properly detect initialization in very dynamic code like
520
+ classes with a custom ``__new__`` method.
521
522
.. _miscellaneous-strictness-flags:
523
0 commit comments