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

PEP 590: Use size_t for "number of arguments + flag" #1066

Merged
merged 23 commits into from May 28, 2019

Conversation

encukou
Copy link
Member

@encukou encukou commented May 21, 2019

In C, bitwise operations are much better defined on unsigned values.
Since we do nargs & ~PY_VECTORCALL_ARGUMENTS_OFFSET, we should do it on an unsigned value.

cc @jdemeyer @markshannon

Bitwise operations are not well defined on signed values in C.
@jdemeyer
Copy link
Contributor

What about changing the name nargs to nargsf or something else?

@jdemeyer
Copy link
Contributor

I think it should be

Py_ssize_t PyVectorcall_NARGS(size_t nargsf)

In all other places, CPython uses Py_ssize_t for number of arguments (even if it can never be negative).

@jdemeyer
Copy link
Contributor

jdemeyer commented May 21, 2019

This conflicts with #1064 (that's why I wanted to do this change after #1064).

@encukou
Copy link
Member Author

encukou commented May 21, 2019

What about changing the name nargs to nargsf or something else?

That's a cosmetic issue, I'm fine leaving it to the implementation/documentation.

Py_ssize_t PyVectorcall_NARGS(size_t nargsf)

OK, sure. I don't care much either way.

This conflicts with #1064 (that's why I wanted to do this change after #1064).

The conflict should be trivial to solve.

@encukou encukou requested a review from markshannon May 21, 2019 12:17
ncoghlan and others added 19 commits May 21, 2019 22:41
Changing the frame API semantics based on whether or not a
tracing function is active is tricky to implement and hard
to document clearly, so this simplifies the proposal by
instead having the frame API always expose a write-through
proxy at function scope, and restricting the dynamic
snapshot behaviour to the locals() builtin.
…ython#1069)

- new design discussion section to cover the requirement that the
  semantics of locals() itself at function scope be left alone
- propose a C level API that exactly matches Python level
  frame.f_locals semantics
- other minor text formatting and wording updates
* Fix markup for wave section

* Add estimated EOL for 3.9

* mention pynntp and why getopt and wave stay

* Add Ned's suggestion
In the Steering Council discussions leading up to the
[2019-04-26 update], I was appointed BDFL delegate for PEPs
576, 579, 580, and 590.
PEP 590 was still just a draft on the mailing list when the
SC updated the PEPs themselves, so it wasn't updated then.

[2019-04-26 update]: https://github.com/python/steering-council/blob/master/updates/2019-04-26_steering-council-update.md#peps
As discussed on the typing-sig mailing list, the currently specified behavior for `# type: ignore` on a line by itself has remained mostly unimplemented and doesn't seem useful. Instead, the PEP now mandates a syntax for ignoring all errors in a specific file, which is more obviously useful.

I considered adding a sentence like "Individual type checkers may add additional syntax for silencing errors", but it didn't seem particularly useful since type checkers in general are free to add extensions to what PEP 484 specifies.

While I was at it I added a reference to PEP 526 to an out-of-date sentence adjacent to the modified paragraph.
* Add my initial draft

* PEP 593: update PEP structure and add content.

* PEP 593: Push updates

* PEP 593: expand the "Improving Roundup" section and move it to the top.

* PEP 593: expand the "Roundup advantages" and "Migration considerations" sections.

* PEP 595 (was 593): expand and reword some sections.

* PEP 595: rename file

* PEP 595: remove Discussion-To header, fix formatting of Author header.
Co-Authored-By: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Add "Experimental Multi-Phase Initialization API" section
* Add PyPreConfig._config_init private field.
* Rename PyInitError to PyStatus.
* Rename PyInitError_Failed() to PyStatus_Exception()
* Rename Py_ExitInitError() to Py_ExitStatusException()
* Fix Python Configuration default values: isolated=0
  and use_environment=1, instead of -1.
* Document isolated field and #ifdef MS_WINDOWS
* Define path conf function
* Fix _init_main=0 example: set config._init_main to 0!
* Document special builds needed by some speficic options like
  show_alloc_count.
* Specify that preconfiguration only requires command line arguments
  for the "Python Configuration" (not for "Isolated Configuration").
* changed refrained to referred

* changed cooperate to corporate
* PEP 594: deprecate telnetlib
* PEP 594: Deprecate email compat32 APIs
* Add 'added in' years to table
* Reference other PEPs, update sections for cgi and audio mods
* Fix typo and table entries (thanks Jelle and Brett)
@jdemeyer
Copy link
Contributor

Can this be merged please?

@encukou
Copy link
Member Author

encukou commented May 28, 2019

Mark seems unavailable – he did not reply to my ping about this PR, but was active on Python-dev.
So I'm merging with review by just one of the PEP authors.

@encukou encukou merged commit 2d9833a into python:master May 28, 2019
@encukou
Copy link
Member Author

encukou commented May 28, 2019

This turned out to look quite messy on GitHub.
The resulting changes is here: 2d9833a

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.

None yet