- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PyCode "Unparse": Added support for slice objects in subscriptions #11981
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests and a CHANGES please?
+ Default slice -> "[:]" + Slice without step size -> "[start:stop]"
("x[:, np.newaxis, :, :]", | ||
"x[:, np.newaxis, :, :]"), # Index, Subscript, numpy extended syntax | ||
("y[:, 1:3][np.array([0, 2, 4]), :]", | ||
"y[:, 1:3][np.array([0, 2, 4]), :]"), # Index, 2x Subscript, numpy extended syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just by looking at all those identity checks, I think we should have used a sentinel value, say IDENTICAL
, to indicate that the output is the same as the input. This is an easy follow-up PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, can you check that #10817 is indeed solved?
Yes, but that will take me a few moments. |
Don't worry, you're fast enough (it also allows me to work on something else in the meantime) |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Yes, #10817 is indeed fixed: temp/__init__.py Ac = "float64[:, :]"
def myfunc(arg: Ac):
"""Some docs"""
... index.rst Welcome to temp's documentation!
================================
.. autofunction:: temp.myfunc
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search` |
Is it possible to include this one as a test as well? |
Thank you! |
Subject: Fix documentation issue when slice objects are used in subscriptions
Feature or Bugfix
Purpose
Detail
Relates