[issue45815] Document exceptions raised by fnmtach

2021-11-16 Thread Dimitri Papadopoulos Orfanos
New submission from Dimitri Papadopoulos Orfanos : The fnmatch documentation should explicitly mention the type of exceptions raised by fnmatch.fnmatch(): https://docs.python.org/3/library/fnmatch.html In my case it raised sre_constants.error, and it took some time to understand

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I've seen the new PR for sorted(), thank you for looking into this. Would it make sense to change list.sort() in the same way? -- ___ Python tracker <https://bugs.python.org/issue45

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I would recommend the wording in the "Sorting HOW TO" from: The sort routines are guaranteed to use __lt__() when making comparisons between two objects. to: The sort routines happen to use __lt__() when making comparisons be

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: Then what about removing it from the list.sort() documentation too? Note that maintainers of other PEPs insist that this is a known fact and base their code on that: https://github.com/python/peps/pull/2077

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Dimitri Papadopoulos Orfanos
Change by Dimitri Papadopoulos Orfanos : -- keywords: +patch pull_requests: +26871 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28472 ___ Python tracker <https://bugs.python.org/issu

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Dimitri Papadopoulos Orfanos
New submission from Dimitri Papadopoulos Orfanos : The documentation of sorted() lacks any reference to the comparison mechanism between items. Compare with the documentation of list.sort(), which starts with: using only < comparisons between items This is mentioned in the "Sor

[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-03-30 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos <dimitri.papadopou...@gmail.com> added the comment: I agree on avoiding a link to str.isspace() and defining "whitespace" instead. However please note there are many de facto definitions of "whitespace". All of them must be documented -

[issue25433] whitespace in strip()/lstrip()/rstrip()

2016-01-04 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: In Python 3 the situation is similar: * The Py_UNICODE_ISSPACE macro is used internally to define str.isspace() and wherever Python needs to detect "whitespace" characters in strings. * There is an equivalent function Py_ISSPACE

[issue25433] whitespace in strip()/lstrip()/rstrip()

2016-01-04 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: In Python 2, as far as I can understand, string.whitespace and str.isspace() are different: * str.isspace() is built upon the C isspace() function and is therefore locale-dependant. Python heavily relies on isspace() to detect "white

[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-03 Thread Dimitri Papadopoulos Orfanos
New submission from Dimitri Papadopoulos Orfanos: About section "7.2.1. Methods of File Objects" of the tutorial: 1. Method read() is documented as follows: reads some quantity of data and returns it as a string or bytes object. Indeed read() returns a string in text mode and bytes

[issue25433] whitespace in strip()/lstrip()/rstrip()

2015-10-18 Thread Dimitri Papadopoulos Orfanos
New submission from Dimitri Papadopoulos Orfanos: The documentation of strip() / lstrip() / rstrip() should define "whitespace" more precisely. The Python 3 documentation refers to "ASCII whitespace" for bytes.strip() / bytes.lstrip() / bytes.rstrip() and "