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

MAINT: [_async_]start_kernel should only take kwarg only. #905

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Dec 23, 2022

The base cases only take **kw, so you can't have subclass also take positional arguments.

It is problematic to allow positional arguments, as is someone code against a subclass it is not swappable for another one.

The latest version of jupyter_server also seem to sometime have subclasses that have the signature with kernel_name first and other with kernel_id first, with is a recipe for disaster if we don't make it kwarg only.

This is I belove not caught by mypy because of multiple reasons:

  1. the use of run_sync in a couple of place,
  2. method assignement might not be handled by mypy.

The base cases only take **kw, so you can't have subclass also take
positional arguments.

It is problematic to allow positional arguments, as is someone code
against a subclass it is not swappable for another one.

The latest version of jupyter_server also seem to sometime have
subclasses that have the signature with kernel_name first and other with
kernel_id first, with is a recipe for disaster if we don't make it kwarg
only.

This is I belove not caught by mypy because of multiple reason:

1) the use of run_sync in a couple of place,
2) method assignement might not be handled by mypy.
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit f9b3b35 into jupyter:main Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants