Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __init__ to subprocess.Popen #3363

Closed
actionless opened this issue Oct 10, 2019 · 4 comments · Fixed by #8203
Closed

Add __init__ to subprocess.Popen #3363

actionless opened this issue Oct 10, 2019 · 4 comments · Fixed by #8203
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@actionless
Copy link

  • Are you reporting a bug, or opening a feature request?
    Bug

  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.

import subprocess

class MyPopen(subprocess.Popen):

    def __init__(self) -> None:
        args = ['echo', 'test']
        super().__init__(
            args=args,
        )
  • What is the actual behavior/output?
$ python -m mypy mypy_subprocess.py
mypy_subprocess.py:9: error: Unexpected keyword argument "args" for "__init__" of "object"
Found 1 error in 1 file (checked 1 source file)
  • What are the versions of mypy and Python you are using?
$ python -m mypy --version
mypy 0.740+dev.742d33a41271206d6eb7dd2e4b04659de4683597

$ python --version
Python 3.7.4
@actionless
Copy link
Author

NOTE: it was working fine with mypy==0.720

@ilevkivskyi
Copy link
Member

This is a subtle problem in typeshed. @msullivan this is a one little additional argument in favour of supporting overloading on self in __init__() I proposed earlier, not that it is something we should do right now, but still.

I think it however makes sense to add a dummy __init__() to suppress this (if this will not cause other troubles). Also potentially we can move this issue to typeshed.

@ilevkivskyi
Copy link
Member

I think this actually belongs in typeshed, I will try the new Github transfer issue feature now.

@ilevkivskyi ilevkivskyi transferred this issue from python/mypy Oct 14, 2019
@JelleZijlstra JelleZijlstra changed the title when calling super method arguments are inherited from object instead of parent class Add __init__ to subprocess.Popen Dec 22, 2021
@JelleZijlstra
Copy link
Member

Renamed the issue to reflect what's actually being asked for.

@srittau srittau added the stubs: incomplete Annotations or sub-modules missing from an existing package or module label Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants