Pycharm incorrectly reports error when __init__ has been re-defined
See original GitHub issueDescribe the bug
Pycharm incorrectly reports error when __init__
method has been re-defined
To Reproduce Steps to reproduce the behavior:
import pydantic
class MyModel(pydantic.BaseModel):
int_field: int
def __init__(self, x=1):
super().__init__(int_field=x)
m = MyModel()
The final line is seen to be highlighted with the apparent error “parameter int_field” unfilled.
Yes I know this example I should use a default value for int_field
, but more generally, it appears that the __init__
signature gets totally ignored on all subclasses of BaseModel.
Expected behavior
If __init__
is re-defined, the new signature should be expected, and no error should be reported.
Environments (please complete the following information):
- IDE: PyCharm Community 2021.1.1
- OS: Windows 10
- Pydantic Version: 1.8.1
- Plugin version: 0.3.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Troubleshooting | PyCharm Documentation - JetBrains
This chapter provides the list of the known problem solutions and workarounds. ... Some import errors are reported in your PyQt code.
Read more >Start Failed, Internal error: recovering IDE to the working state ...
There are multiple possible causes for this issue: broken or incompatible plug-in, corrupted IDE installation files, failed patch update, broken caches or ...
Read more >PyCharm 181.4203.547 Release Notes | Knowledge Base
Feature PY‑20770 Support Python 3.6 asynchronous generators and comprehensions
Feature PY‑21768 Semantic highlighting for Python
Bug PY‑19573 Python console ‑ no output under OS X
Bug...
Read more >pycharm incorrectly stating: `function "__init__" cannot be async`
pycharm thinks that my code won't run and adds squigly red underlines to every file in the directory chain in project view.
Read more >PyCharm 2020.1 Release Notes | Knowledge Base - YouTrack
No subsystem Bug PY‑39484
Code Insight Feature PY‑39499
Bug PY‑40738
Bug PY‑25838
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks again! It looks resolved to me, I appreciate the quick response!
@PhilReinhold The new version 0.3.3 has been released that is fixed the problem 🎉