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

super(): no arguments #1732

Closed
bersbersbers opened this issue Nov 14, 2024 · 2 comments
Closed

super(): no arguments #1732

bersbersbers opened this issue Nov 14, 2024 · 2 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@bersbersbers
Copy link

Environment data

  • debugpy version: 1.8.7
  • OS and version: Win 11 24H2
  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.0 via uv
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Cannot run super() in Debug Console

Expected behavior

Can run super() in Debug Console

Steps to reproduce:

class A:
    def method(self):
        print("super!")

class B(A):
    def method(self):
        super().method()

B().method()
  1. Set breakpoint in line super().method()
  2. Run file with debugger attached
  3. At breakpoint, run super().method() in Debug Console

Image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Nov 14, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Nov 14, 2024

Thanks for the issue but that's by design. The debugger is just running what you type in a python eval call. super() isn't allowed in an eval call.

super() really means super(__class__, self). See this PEP: https://peps.python.org/pep-3135/

If you want this to work, you'd do this instead:

super(__class__, self).method()

@rchiodo rchiodo closed this as completed Nov 14, 2024
@bersbersbers
Copy link
Author

Thanks - learned something 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants