Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-27867: Add a porting guide for PySlice_GetIndicesEx().#1973

Merged
serhiy-storchaka merged 8 commits into
python:masterpython/cpython:masterfrom
serhiy-storchaka:PySlice_GetIndicesEx-porting-guideserhiy-storchaka/cpython:PySlice_GetIndicesEx-porting-guideCopy head branch name to clipboard
Oct 8, 2017
Merged

bpo-27867: Add a porting guide for PySlice_GetIndicesEx().#1973
serhiy-storchaka merged 8 commits into
python:masterpython/cpython:masterfrom
serhiy-storchaka:PySlice_GetIndicesEx-porting-guideserhiy-storchaka/cpython:PySlice_GetIndicesEx-porting-guideCopy head branch name to clipboard

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 6, 2017

Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka added the docs Documentation in the Doc dir label Jun 6, 2017
Comment thread Doc/c-api/slice.rst Outdated
Returns ``0`` on success and ``-1`` on error with exception set.

.. note::
This function considered not safe for resizable sequences. Replace its invocation ::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a typo? Maybe is considered? Also there is a whitespace before ::. I do not know if it is intentional, considering you apply the :: without a whitespace in the sentence below

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you. Yes, this is a typo. A whitespace before :: is intentional.

@cryvate cryvate left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The manual change looks good to me (could improve still), the what's new blurb is a tad confusing.

Comment thread Doc/c-api/slice.rst Outdated
Returns ``0`` on success and ``-1`` on error with exception set.

.. note::
This function is considered not safe for resizable sequences. Replace its invocation ::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought about "is considered not" v.s. "is not considered" for a while, but actually the former/current version as its semantics seem more appropriate

Comment thread Doc/c-api/slice.rst Outdated
// return error
}

with using functions :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices`::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You want to link to these functions here? It makes the sentence a bit of a roller coaster.

Could it be possible to move the "using ..." to after the code block? so:

with

if (Py [...]

using functions :c: ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or restructure it, so that the whole block is

"This function is considered not safe for resizable sequences. Its invocation should be replaced by a combination of :c:... and :c:... where

if (PySlice_Get[...]

is replaced by

if (PySlice_Unpack..."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you, I'll restructure it.

Comment thread Doc/whatsnew/3.7.rst Outdated
Changes in the C API
--------------------

* Function :c:func:`PySlice_GetIndicesEx` is considered not safe for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Function" -> "The function"

Comment thread Doc/whatsnew/3.7.rst Outdated

* Function :c:func:`PySlice_GetIndicesEx` is considered not safe for
resizable sequences. It takes the current length of the sequence, but
if the slice indices are not instances of :class:`int`, but objects that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"[...] instances of :class:int" seems like an unended thoought. The double but in a row ("but if ..", "but objects") is quite confusing. Consider splitting into 2 or more sentences?

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Thank you @cryvate for your review.

@cryvate

cryvate commented Sep 23, 2017

Copy link
Copy Markdown
Contributor

No problem @serhiy-storchaka . Really like what you've changed it to.

Comment thread Doc/c-api/slice.rst Outdated

is replaced by ::

if (PySlice_Unpack(slice, length, &start, &stop, &step) < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove length from argument list.

@serhiy-storchaka serhiy-storchaka merged commit 4d3f084 into python:master Oct 8, 2017
@serhiy-storchaka serhiy-storchaka deleted the PySlice_GetIndicesEx-porting-guide branch October 8, 2017 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.