Skip to content

bpo-38316: describe co_stacksize a little bit better - #16983

Merged
vstinner merged 1 commit into
python:masterfrom
isidentical:bpo-38316
Dec 15, 2019
Merged

vstinner merged 1 commit into
python:masterfrom
isidentical:bpo-38316

Conversation

@isidentical

@isidentical isidentical commented Oct 29, 2019 •

Copy link
Copy Markdown
Member

Comment thread Doc/reference/datamodel.rst Outdated
@ammaraskar

Copy link
Copy Markdown
Member

hmm, now that I think about this more. I think more appropriate wording would be:

co_stacksize is the largest size the stack will grow to when executing the function;

@isidentical

Copy link
Copy Markdown
Member Author

@ammaraskar can you check it now?

@ammaraskar ammaraskar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with final suggestion

Comment thread Doc/reference/datamodel.rst Outdated
@ammaraskar

Copy link
Copy Markdown
Member

@vstinner Would you mind taking a look at this?

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Objects/frameobject.c allocates an array of code->co_stacksize + code->co_nlocals + ncells + nfrees items. The array size doesn't chagne during the execution of the function, it's not like x86 machine mode which manipulates the stack pointer (SP) register and use PUSH/POP.

:attr:co_stacksize is the required stack size (including local variables)

So this definition sounds wrong to me.

Instead, I suggest this definition:

:attr:`co_stacksize` is the required stack size

=> just remove (including local variables).

@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@isidentical

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@vstinner: please review the changes made to this pull request.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @isidentical for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @isidentical for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @isidentical and @vstinner, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d587272fe3b0fcad2f23a490e76f9f82ca7d64ef 3.7

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @isidentical and @vstinner, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker d587272fe3b0fcad2f23a490e76f9f82ca7d64ef 3.8

@vstinner

Copy link
Copy Markdown
Member

@isidentical: The automated backport to 3.7 and 3.8 failed. Can you please try to manually backport these changes? Use " cherry_picker d587272 3.8" or "git cherry-pick -x d587272".

@vstinner

Copy link
Copy Markdown
Member

Ping @isidentical, tell me if you prefer that I do the backport.

@isidentical

Copy link
Copy Markdown
Member Author

Thanks for the ping @vstinner, I totally forgot backports. Sending them right away

isidentical added a commit to isidentical/cpython that referenced this pull request Dec 19, 2019
(cherry picked from commit d587272)

Co-authored-by: Batuhan Taşkaya <[email protected]>
@bedevere-bot

Copy link
Copy Markdown

GH-17660 is a backport of this pull request to the 3.7 branch.

isidentical added a commit to isidentical/cpython that referenced this pull request Dec 19, 2019
(cherry picked from commit d587272)

Co-authored-by: Batuhan Taşkaya <[email protected]>
@bedevere-bot

Copy link
Copy Markdown

GH-17661 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit that referenced this pull request Dec 19, 2019
miss-islington pushed a commit that referenced this pull request Dec 19, 2019
(cherry picked from commit d587272)

Co-authored-by: Batuhan Taşkaya <[email protected]>





https://bugs.python.org/issue38316



Automerge-Triggered-By: @vstinner
@isidentical
isidentical deleted the bpo-38316 branch December 19, 2019 14:51
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
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