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 opcode to check for returning None in __init__ #515

Open
tekknolagi opened this issue Jun 20, 2023 · 4 comments
Open

Add opcode to check for returning None in __init__ #515

tekknolagi opened this issue Jun 20, 2023 · 4 comments

Comments

@tekknolagi
Copy link
Owner

python/cpython@main...faster-cpython:cpython:specialize-calls-to-python-classes

This is "easy" for normal def __init__ but harder for __init__ = x and ty.__init__ = x because you have to hook and re-instrument or something.

@tekknolagi
Copy link
Owner Author

Unless---oops---it actually puts that opcode after CALL_FUNCTION to type, instead of inside the method

@tekknolagi
Copy link
Owner Author

Oh it's a shim frame, neat

@tekknolagi
Copy link
Owner Author

I wonder how we could push that frame very fast without doing the sort of static-alloc and pointer link thing they do in CPython

@tekknolagi
Copy link
Owner Author

python/cpython@04492cb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant