Skip to content

[DOC] Snippet code to str methods #24666

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

Closed
wants to merge 1,265 commits into from
Closed

Conversation

adorilson
Copy link
Contributor

@adorilson adorilson commented Feb 28, 2021

This PR improvements the str method documentation, adding snippet code in the follows methods and other minor improvements:

  • capitalize
  • casefold
  • center
  • count
  • encode
  • endswith
  • expandtabs
  • find
  • index
  • isalnum
  • isalpha
  • isascii
  • isdecimal
  • isdigit
  • isidentifier
  • islower
  • isnumeric
  • isprintable
  • isspace
  • istitle
  • join
  • ljust
  • lower
  • lstrip
  • maketrans
  • partition
  • replace
  • rindex
  • rjust
  • rpartition
  • rsplit
  • rstrip
  • startswith
  • swapcase
  • translate
  • upper

vstinner and others added 27 commits March 10, 2021 21:37
Move faulthandler._fatal_error() to _testcapi.fatal_error().
* Replace buffered fprintf() with unbuffered _Py_write_noraise()
  in Py_FatalError().
* _Py_DumpHexadecimal() now accepts uintptr_t.
The Py_FatalError() function and the faulthandler module now dump the
list of extension modules on a fatal error.

Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal
functions.
When stdin is a TTY, the test added in commit c13d899
is expected to fail. However, when it failed, it did not close
its file descriptors. This is flagged by the refleak tests (but
only when stdin is a TTY, which doesn't seem to be the case on CI).
Add a private list of all stdlib modules: _Py_module_names.

* Add Tools/scripts/generate_module_names.py script.
* Makefile: Add "make regen-module-names" command.
* setup.py: Add --list-module-names option.
* GitHub Action and Travis CI also runs "make regen-module-names",
  not ony "make regen-all", to ensure that the module names remains
  up to date.
* addCleanupClass  -> addClassCleanup
* doCleanupsClass -> doClassCleanups
…4210)

Add --with-wheel-pkg-dir=PATH option to the ./configure script. If
specified, the ensurepip module looks for setuptools and pip wheel
packages in this directory: if both are present, these wheel packages
are used instead of ensurepip bundled wheel packages.

Some Linux distribution packaging policies recommend against bundling
dependencies. For example, Fedora installs wheel packages in the
/usr/share/python-wheels/ directory and don't install the
ensurepip._bundled package.

ensurepip: Remove unused runpy import.
@vstinner [noticed on python-dev](https://mail.python.org/archives/list/[email protected]/thread/O3T7SK3BGMFWMLCQXDODZJSBL42AUWTR/) that there is no what's new or porting entry for removal of asyncio ``loop`` parameter. 

This patch adds a basic guide.

Co-Authored-By: Kyle Stanley <[email protected]>
bidst_wheel -> bdist_wheel

Automerge-Triggered-By: GH:Mariatta
@adorilson
Copy link
Contributor Author

The docs build failed, but I did not get the error. In my PC this build works properly.

@MaxwellDupre
Copy link
Contributor

Docs wont build with your changes/setup. I can compile the Docs from the current main.
The error I get is:
omplex.rst:49:Error in declarator or parameters
Error in declarator or parameters
Invalid C declaration: Expected identifier, got user-defined keyword: complex. Remove it from c_extra_keywords to allow it as identifier.
Currently c_extra_keywords is ['alignas', 'alignof', 'bool', 'complex', 'imaginary', 'noreturn', 'static_assert', 'thread_local']. [error at 39]
Py_complex _Py_c_neg(Py_complex complex)
---------------------------------------^
make: *** [Makefile:51: build] Error 2


NB I see the first change in Doc/library/array.rst does not exist in current Python 3 docs. Hence you will need to see if this is still relevant.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 4, 2022
@ghost
Copy link

ghost commented Oct 11, 2022

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@adorilson
Copy link
Contributor Author

Docs wont build with your changes/setup. I can compile the Docs from the current main. The error I get is: omplex.rst:49:Error in declarator or parameters Error in declarator or parameters Invalid C declaration: Expected identifier, got user-defined keyword: complex. Remove it from c_extra_keywords to allow it as identifier. Currently c_extra_keywords is ['alignas', 'alignof', 'bool', 'complex', 'imaginary', 'noreturn', 'static_assert', 'thread_local']. [error at 39] Py_complex _Py_c_neg(Py_complex complex) ---------------------------------------^ make: *** [Makefile:51: build] Error 2

I just building in my PC and this works perfectly. I have synchronized with upstream before.

NB I see the first change in Doc/library/array.rst does not exist in current Python 3 docs. Hence you will need to see if this is still relevant.

I doesn't touched in this file. Only Doc/library/stdtypes.rst.

@slateny
Copy link
Contributor

slateny commented Oct 12, 2022

Can you rebase the branch / cherry-pick the commits so it doesn't grab all the 1k+ commits from main? I'm also not too sure about adding so many examples as it would make the page a bit bloated, but I'll let someone else comment on them.

@adorilson
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

: please review the changes made to this pull request.

@adorilson
Copy link
Contributor Author

In fact, the change was in a new branch/PR #105670

@AlexWaygood
Copy link
Member

closing in favour of #105670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting change review docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.