[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 64f9e7b19dc1603fcbd07c17c9860085b9d21465 by Serhiy Storchaka in 
branch 'main':
bpo-44940: Clarify the documentation of re.findall() (GH-27849)
https://github.com/python/cpython/commit/64f9e7b19dc1603fcbd07c17c9860085b9d21465


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26335
pull_request: https://github.com/python/cpython/pull/27880

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +26334
pull_request: https://github.com/python/cpython/pull/27879

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a9640d75531d6cbbfd254b65435f238c26bf5cd9 by Serhiy Storchaka in 
branch 'main':
bpo-44955: Always call stopTestRun() for implicitly created TestResult objects 
(GH-27831)
https://github.com/python/cpython/commit/a9640d75531d6cbbfd254b65435f238c26bf5cd9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +26336
pull_request: https://github.com/python/cpython/pull/27881

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26337
pull_request: https://github.com/python/cpython/pull/27882

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread miss-islington


miss-islington  added the comment:


New changeset 519bcc698c436e12bd6c1ff6f2517060719c60d5 by Miss Islington (bot) 
in branch '3.10':
bpo-44940: Clarify the documentation of re.findall() (GH-27849)
https://github.com/python/cpython/commit/519bcc698c436e12bd6c1ff6f2517060719c60d5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread miss-islington


miss-islington  added the comment:


New changeset d63114caf9384ead7baf872598acdff25315a5bf by Miss Islington (bot) 
in branch '3.10':
bpo-44955: Always call stopTestRun() for implicitly created TestResult objects 
(GH-27831)
https://github.com/python/cpython/commit/d63114caf9384ead7baf872598acdff25315a5bf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your report Ryan. Indeed, there was a bug introduced during 
refactoring (one unneeded "yield" was kept), and there was a bug before 
refactoring (the transport was not closed).

I'll open a new issue about "Unknown child process pid".

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44974] Warning about "Unknown child process pid" in test_asyncio

2021-08-22 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Ryan Mast reported about a warning about "Unknown child process pid" after 
finishing test_asyncio (see msg400018 and 
https://github.com/python/cpython/pull/27870#issuecomment-903072119 for 
details).

I cannot reproduce it locally. Ryan, could you help with locating the source of 
this warning? First suspect is test_close_dont_kill_finished. If it is not, it 
may be other test calling kill().

--
components: Tests, asyncio
messages: 400057
nosy: asvetlov, rmast, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Warning about "Unknown child process pid" in test_asyncio
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-08-22 Thread ty


ty  added the comment:

Hello and PING.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass

2021-08-22 Thread Ken Jin


New submission from Ken Jin :

This is a feature request by a user at 
https://github.com/python/typing/issues/822.

A copy of their request:
Currently issubclass cannot be used for runtime_checkable protocols with data 
members, because those attributes could be set in __init__. I propose to relax 
this restriction to allow protocols with ClassVar members, as those should be 
present in the class definition.

I'm unsure if I need to update PEP 544 too. I don't remember if PEPs can be 
updated when 'Accepted', or was it 'Final' PEPs that can't be updated anymore?

--
assignee: kj
components: Library (Lib)
messages: 400059
nosy: Jelle Zijlstra, gvanrossum, kj
priority: normal
severity: normal
status: open
title: [typing] Runtime protocols with ClassVar data members should support 
issubclass
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass

2021-08-22 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +26338
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27883

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44547] fraction.Fraction does not implement __int__.

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

I think there's no reason not to keep __trunc__ and math.trunc - they're 
natural counterparts to floor and ceil, and there's probably at least some code 
out there already using math.trunc.

It's the involvement of __trunc__ in the int() builtin that I'd quite like to 
deprecate and eventually remove. I think at this point it complicates the 
object model for no particularly good reason. But this is getting off-topic for 
this issue; I'll open a new one.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a bug because there is a difference between the following cases:

@skip("skipped")
def test1(self):
...

@other_decorator
@skip("skipped")
def test2(self):
...

def test2(self):
self.skipTest("skipped")
...

None is only returned in the first case. In other two cases a TestResult is 
returned with information about skipping.

It is obvious that it was unintentionally.

I just have fixed similar bug about calling stopTestRun() (issue44955).

Iman, please add tests and a NEWS entry. You can use tests added in issue44955 
as an example.

--
components: +Library (Lib)
nosy: +serhiy.storchaka
stage:  -> test needed
type:  -> behavior
versions: +Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44976] [sqlite3] lazy creation of result rows

2021-08-22 Thread Erlend E. Aasland

New submission from Erlend E. Aasland :

Currently, we build the first result row in the _pysqlite_query_execute() loop 
if sqlite3_step() returned SQLITE_ROW. When the user asks for a row (for 
example, using sqlite3.Cursor.fetchone()), this pre-built row is returned, and 
the next row is prepared.

Suggesting to lazily build result rows instead.

Cons:
- no result tuples are built unless sqlite3.Cursor.fetch*() is called
- no need to keep the next result row (tuple) in pysqlite_Cursor; rows are 
built on demand
- pysqlite_cursor_iternext() is vastly simplified (50% less lines of code)
- the main loop in _pysqlite_query_execute() is further simplified

Cons:
- code churn


git diff main --shortstat: 2 files changed, 29 insertions(+), 58 deletions(-)

--
components: Extension Modules
messages: 400062
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] lazy creation of result rows
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44976] [sqlite3] lazy creation of result rows

2021-08-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
keywords: +patch
pull_requests: +26339
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27884

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Mark Dickinson


New submission from Mark Dickinson :

The int constructor, when applied to a general Python object `obj`, first looks 
for an __int__ method, then for an __index__ method, and then finally for a 
__trunc__ method.

The delegation to __trunc__ used to be useful: it meant that users could write 
a custom class SomeNumber with the property that:

- SomeNumber instances supported 'int' calls, returning a truncated value, but
- SomeNumber instances weren't usable in indexing, chr() calls, and all the 
various other calls that implicitly invoked __int__.

class SomeNumber:
def __trunc__(self):
   

However, with Python >= 3.10, we no longer use __int__ implicitly for argument 
conversion in internal code. So the second point above is no longer a concern, 
and SomeNumber can now simply be written as

class SomeNumber:
def __int__(self):
   

This decouples int from __trunc__ and leaves __trunc__ as simply the support 
for the math.trunc function.

--
messages: 400063
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Deprecate delegation of int to __trunc__?

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

> This decouples int from __trunc__ and leaves __trunc__ as simply the support 
> for the math.trunc function.

Argh; copy and paste fail - I left out the crucial line.

I propose deprecating the delegation of int to __trunc__: calls to int(a) where 
type(a) implements __trunc__ but not __int__ or __index__ would raise a 
DeprecationWarning, and at some point in the future int(a) would become a 
TypeError.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44976] [sqlite3] lazy creation of result rows

2021-08-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Historical note:
The current behaviour was introduced in pysqlite v2.0.2 (May 21 2005), in order 
to be able to finalise statements and thus close cursors as soon as possible. 
However, that effect was cancelled just after a couple of months, by the 
addition of the LRU cache and the ability to reuse prepared statements.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44978] Argument Clinic should not exclude __complex__ methods

2021-08-22 Thread Mark Dickinson


New submission from Mark Dickinson :

The argument clinic currently refuses to handle a __complex__ method. However, 
unlike __int__ and __float__, __complex__ should require no special handling by 
the argument clinic, since there's no dedicated slot for the __complex__ method.

PR arriving shortly.

--
components: Demos and Tools
messages: 400066
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Argument Clinic should not exclude __complex__ methods
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44978] Argument Clinic should not exclude __complex__ methods

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
keywords: +patch
pull_requests: +26340
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27886

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

If the goal is to have `isinstance(obj, typing.SupportsComplex)` pass for 
objects that are convertible to complex, then we'll need `int.__complex__` and 
`float.__complex__` implementations as well as `complex.__complex__`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

> [...] we'll need `int.__complex__` and `float.__complex__` implementations as 
> well as `complex.__complex__`.

The real problem here is that the "typing.SupportsComplex" protocol isn't a 
good match for code that needs to know that a given value `x` can be treated as 
though it were a complex number.

The test that best matches "usable as a complex number" seems to be that 
type(x) implements at least one of `__index__`, `__float__` or `__complex__`, 
or that `x` is a subclass of complex.

It looks to me as though the right thing to do here is to just implement 
complex.__complex__, but not int.__complex__ or float.__complex__.  Then at 
least we can remove the subclass test from the above and express the test 
purely in terms of special methods: __index__, __float__ and __complex__. And 
then perhaps it's for the typing module to find a more convenient way to 
express the union of typing.SupportsIndex, typing.SupportsFloat and 
typing.SupportsComplex.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44978] Argument Clinic should not exclude __complex__ methods

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset c5c3fbe2a16a8fcb77eb98eda53efb3e03b863ca by Mark Dickinson in 
branch 'main':
bpo-44978: allow Argument Clinic to handle __complex__ special methods 
(GH-27886)
https://github.com/python/cpython/commit/c5c3fbe2a16a8fcb77eb98eda53efb3e03b863ca


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
keywords: +patch
pull_requests: +26341
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27887

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44913] segfault in call to embedded PyModule_New

2021-08-22 Thread Madhu


Madhu  added the comment:

*  hai shi  
<1629603770.32.0.682495978946.issue44...@roundup.psfhosted.org>
Wrote on Sun, 22 Aug 2021 03:42:50 +

> hai shi  added the comment:

> How about this one?
>
>   if (!Py_IsInitialized()) {
> return -1;
>   }

[When this extension is loaded into a C program rather than a python
script, then Python should be initialized here rather than quitting]

>   PyGILState_STATE state = PyGILState_Ensure();
>   PyObject *module_handle = PyModule_New(module_name);
>   if (module_handle == 0)
>   {
> fprintf(stderr,"PyModule_New(module_data_name=%s) failed\n",
> module_name);
> exit(1);
>   }
>   fprintf(stdout, "point is: %p\n", module_handle);
>   fprintf(stderr, "foo END\n");
>   PyGILState_Release(state);

Yes. Thanks. Calling PyGILState_Ensure and PyGILState_Release around
the call to PyModule_New does avoid the segfault.

It is a little tricky to do this in pam-python - because although
there is one entrypoint into the extension (which can be wrapped
within the calls to PyGILState_Ensure/Release), python is initialized
within that entrypoint, but I think this can be solved another way.

Thanks

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44978] Argument Clinic should not exclude __complex__ methods

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
assignee:  -> mark.dickinson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32082] atexit module: allow getting/setting list of handlers directly

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks, Irit. Should we close this issue as a duplicate? It's not identical 
(being able to modify the list of handlers versus just being able to inspect 
it), but it's pretty close.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44019] operator.call/operator.__call__

2021-08-22 Thread Antony Lee


Change by Antony Lee :


--
keywords: +patch
pull_requests: +26342
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27888

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39301] Specification of bitshift on integers should clearly state floor division used

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing; I think this is addressed.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37082] Assignment expression symbol (walrus) not in built-in help()

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Completely agree.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Afterwards, do __trunc__ and math.trunc() still need to exist?

They were mostly unused.  Now they would also be unnecessary.  Just having them 
around would be a point of confusion.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44979] pathlib: support relative path construction

2021-08-22 Thread Kirill Pinchuk


New submission from Kirill Pinchuk :

Hi. I've been using this snippet for years and believe that it would be a nice 
addition to pathlib's functionality.

Basically, it allows constructing path relative to the current file (instead of 
cwd). Comes quite handy when you're working with deeply nested resources like 
file fixtures in tests and many other cases.

```
@classmethod
def relative(cls, path, depth=1):
"""
Return path that is constructed relatively to caller file.
"""
base = Path(sys._getframe(depth).f_code.co_filename).parent
return (base / path).resolve()
```

--
components: Library (Lib)
messages: 400075
nosy: cybergrind
priority: normal
severity: normal
status: open
title: pathlib: support relative path construction
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-22 Thread Bastian Neuburger


Change by Bastian Neuburger :


--
keywords: +patch
pull_requests: +26343
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27889

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

A GitHub code search shows a substantial number of uses of math.trunc out in 
the wild:

https://github.com/search?q=math.trunc+extension%3Apy&type=Code

So unfortunately, getting rid of math.trunc and __trunc__ looks a bit too much 
as though it would cause gratuitous breakage.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44979] pathlib: support relative path construction

2021-08-22 Thread Kirill Pinchuk


Change by Kirill Pinchuk :


--
keywords: +patch
pull_requests: +26344
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27890

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-22 Thread Bastian Neuburger


Bastian Neuburger  added the comment:

Steve, I signed the CLA and created the PR, I don't know how long it takes 
until the info that the CLA is signed is propagated to bpo or github.

Regarding failed builds: I will try to build again tomorrow when back at the 
office and can copy the errors, how would you like to receive them?

For building I spun up a MS Windows 10 Edge Test VM, installed Visual Studio 
2019 and then tried to run get_externals.bat; that already failed since the 
nuget config was empty and thus had no upstreams configured. Maybe this problem 
stems from the free test VM. After editing the nuget config, that script worked 
out fine and then I run build.bat, which seemed to be quite busy for at least 
10 minutes, then I left my office. Upon return I saw plenty of errors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Possibly, we could have math.trunc() call __int__, letting us deprecate 
__trunc__.

That would let users avoid gratuitous aliasing such as that in _pydecimal.py:

   __trunc__ = __int__

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think that math.trunc() for UUID or IP4Address makes sense.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

I think the needs are sufficiently different that __trunc__ still has value as 
its own thing, and it's a natural counterpart to __floor__ and __ceil__ (out of 
all the directed rounding modes, rounding towards zero probably turns up more 
often than rounding towards +inf or -inf).

__int__ has the disadvantage that it must return an int, so it's not useful for 
other Python-based numeric systems with their own rational number / integer 
pairing. For example, with gmpy2, truncating an mpq instance returns an mpz 
instance, which is what I'd expect and want - if I'm working with huge values 
then it would be annoying for math.trunc to do the inefficient thing and return 
a plain int.

>>> from gmpy2 import mpq
>>> math.trunc(mpq(22, 7))
mpz(3)

SymPy behaves similarly:

>>> from sympy import Rational
>>> type(math.trunc(Rational(22, 7)))


On the other side, there are conversions to integer that it doesn't make sense 
to think of as truncation. It would be odd for a UUID to be a valid input to 
math.trunc, for example:

>>> int(uuid.uuid4())
43341414945793370480422623795805641537

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44973] @classmethod can be stacked on @property, but @staticmethod cannot

2021-08-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The classmethod and staticmethod decorators have somewhat different semantics.  
Accessing a classmethod with C.cm creates a bound method object which has both 
__call__ and __get__.  In contrast, accessing a staticmethod with C.sm returns 
the underlying function.  So there is no opportunity for a customized __get__ 
method as we have with classmethod.

Also, even if C.sm did return a custom descriptor, the code example still can't 
be made to work because the __get__ method on property objects is hardwired to 
pass in an instance.¹  That means that the underlying method must have a "self" 
argument.  

Another issue is that properties have __set__ and __delete__ methods which 
could not be made to work without a reference to the class or instance.

To make a read-only class variable, a metaclass would be needed.  While it is 
possible to write a descriptor to make C.FINE_STRUCTURE_CONSTANT call a 
function that returns 1/137, there is no way for the descriptors to block the 
assignment:  C.FINE_STRUCTURE_CONSTANT = 1 / 100

Thanks for the suggestion, but I don't think this can be made to work.  

¹ https://docs.python.org/3/howto/descriptor.html#properties

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I retract the suggestion to deprecate __trunc__.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44973] @classmethod can be stacked on @property, but @staticmethod cannot

2021-08-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44980] Clean up a few tests that return a value!=None

2021-08-22 Thread Andrei Kulakov


New submission from Andrei Kulakov :

In #41322 the behavior of returning a value!=None from test methods was 
deprecated, there are currently a few tests in Python that do that; it would be 
good to fix them to be consistent with our deprecation requirement and to avoid 
deprecation warnings in test runs; it may also possibly surface unexpected 
issues when reviewing these tests.

- there are two distutils tests - test_quiet and test_no_optimize_flag -- 
probably not worth it to investigate them as distutils is set for removal in 
3.12

- test_null_strings in CAPI

- test_constructor in test_code

I'll try to fix the two tests above today.

--
components: Tests
messages: 400083
nosy: andrei.avk
priority: normal
severity: normal
status: open
title: Clean up a few tests that return a value!=None

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4e5162fd369baf25dd16a42ccd0fa7756744f4d0 by Miss Islington (bot) 
in branch '3.9':
bpo-44955: Always call stopTestRun() for implicitly created TestResult objects 
(GH-27831) (GH-27882)
https://github.com/python/cpython/commit/4e5162fd369baf25dd16a42ccd0fa7756744f4d0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d006392245c904547e5727144235c2f9d7948e96 by Miss Islington (bot) 
in branch '3.9':
bpo-44940: Clarify the documentation of re.findall() (GH-27849) (GH-27880)
https://github.com/python/cpython/commit/d006392245c904547e5727144235c2f9d7948e96


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44926] typing.get_type_hints() raises for type aliases with forward references

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9ffe582a018a2babd14e874ae2b169370633fe33 by Miss Islington (bot) 
in branch '3.10':
bpo-44926: `get_type_hints`: Add note about type aliases with forward refs 
(GH-27859) (GH-27860)
https://github.com/python/cpython/commit/9ffe582a018a2babd14e874ae2b169370633fe33


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b1db308c6114bb18c06656c94c0ffa73ba954977 by andrei kulakov in 
branch 'main':
bpo-41322: Add unit tests for deprecation of test return values (GH-27846)
https://github.com/python/cpython/commit/b1db308c6114bb18c06656c94c0ffa73ba954977


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset d1049d1d6b43296d4db1aa8668aa4ca807bf7adb by Mark Roseman in 
branch 'main':
bpo-42560: rework external references in Tkinter docs (GH-27838)
https://github.com/python/cpython/commit/d1049d1d6b43296d4db1aa8668aa4ca807bf7adb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 141c7a4fce8def67baa9d24f542c105b8502893e by Mark Roseman in 
branch 'main':
bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState 
(GH-27835)
https://github.com/python/cpython/commit/141c7a4fce8def67baa9d24f542c105b8502893e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +26346
pull_request: https://github.com/python/cpython/pull/27891

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26347
pull_request: https://github.com/python/cpython/pull/27892

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Functions registered with TestCase.addClassCleanup are called because TestCase 
has default implementation of tearDownClass. But you can suppress it by setting 
tearDownClass = None. So there is a similar issue with class cleanup functions.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26348
pull_request: https://github.com/python/cpython/pull/27893

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26350
pull_request: https://github.com/python/cpython/pull/27895

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset d5dbe8bca792350f4997c027535e0ca498abd1bb by Mark Roseman in 
branch 'main':
 bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840)
https://github.com/python/cpython/commit/d5dbe8bca792350f4997c027535e0ca498abd1bb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26349
pull_request: https://github.com/python/cpython/pull/27894

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26351
pull_request: https://github.com/python/cpython/pull/27896

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26352
pull_request: https://github.com/python/cpython/pull/27897

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset dabb6e8ddd7626266184ba022bcb76f74196248f by Sebastian Rittau in 
branch 'main':
bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)
https://github.com/python/cpython/commit/dabb6e8ddd7626266184ba022bcb76f74196248f


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


miss-islington  added the comment:


New changeset 61ecd3e593e05c3d84adf5640458a01f8550aa74 by Miss Islington (bot) 
in branch '3.10':
bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState 
(GH-27835)
https://github.com/python/cpython/commit/61ecd3e593e05c3d84adf5640458a01f8550aa74


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e74cf8667d7d73e6cacd5d0aedcecbd20e711d6a by Miss Islington (bot) 
in branch '3.9':
bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState 
(GH-27835) (GH-27892)
https://github.com/python/cpython/commit/e74cf8667d7d73e6cacd5d0aedcecbd20e711d6a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread miss-islington


miss-islington  added the comment:


New changeset 4d1e74f352d8bf70b726b373e19fd21274899d8e by Miss Islington (bot) 
in branch '3.10':
bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840)
https://github.com/python/cpython/commit/4d1e74f352d8bf70b726b373e19fd21274899d8e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8e90f15ac88c66ddb7b084bb5780a126d35168af by Łukasz Langa in 
branch '3.10':
[3.10] bpo-42560: rework external references in Tkinter docs (GH-27838) 
(GH-27893)
https://github.com/python/cpython/commit/8e90f15ac88c66ddb7b084bb5780a126d35168af


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset c579f0ba62974b90f348e50088e4c036e281f45e by Łukasz Langa in 
branch '3.9':
[3.9] bpo-42560: rework external references in Tkinter docs (GH-27838) 
(GH-27896)
https://github.com/python/cpython/commit/c579f0ba62974b90f348e50088e4c036e281f45e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 986750be5c7914f4b0120f5627fe848dcced103b by Miss Islington (bot) 
in branch '3.9':
bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840) 
(GH-27895)
https://github.com/python/cpython/commit/986750be5c7914f4b0120f5627fe848dcced103b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44980] Clean up a few tests that return a value!=None

2021-08-22 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
pull_requests: +26353
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27898

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +26354
pull_request: https://github.com/python/cpython/pull/27899

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset eec340ea3af27887fcaac4029ebdee99f3713bff by Raymond Hettinger in 
branch 'main':
bpo-4442:  Document use of __new__ for subclasses of immutable types (GH-27866)
https://github.com/python/cpython/commit/eec340ea3af27887fcaac4029ebdee99f3713bff


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26355
pull_request: https://github.com/python/cpython/pull/27900

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread miss-islington


miss-islington  added the comment:


New changeset 0627918f0b69a15aa16e4ccbb5d8eaae4f6a2caf by Miss Islington (bot) 
in branch '3.10':
bpo-4442:  Document use of __new__ for subclasses of immutable types (GH-27866)
https://github.com/python/cpython/commit/0627918f0b69a15aa16e4ccbb5d8eaae4f6a2caf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17359] Mention "__main__.py" explicitly in command line docs

2021-08-22 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 8.0 -> 9.0
pull_requests: +26356
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26883

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24632] Improve documentation about __main__.py

2021-08-22 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 11.0 -> 12.0
pull_requests: +26357
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26883

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-22 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I agree with Serhiy that this API isn't necessarily the right one. It's just 
what happens to be there now. Also, we're still not clear on our stance towards 
cycles (see the issue25782 discussion). (Maybe the exposed version should 
result in an error if it would cause a cycle to be created.) Someone would need 
to think through what the API should be, though.

--
nosy: +chris.jerdonek

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Sebastian! ✨ 🍰 ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ac87b07a10e0ba2834e8de9cf0ea29a40fd882b1 by Łukasz Langa in 
branch '3.9':
[3.9] bpo-4442:  Document use of __new__ for subclasses of immutable types 
(GH-27866) (GH-27900)
https://github.com/python/cpython/commit/ac87b07a10e0ba2834e8de9cf0ea29a40fd882b1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4442] document immutable type subclassing via __new__

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for the patch, Raymond! ✨ 🍰 ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44980] Clean up tests that return a value that isn't None

2021-08-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
title: Clean up a few tests that return a value!=None -> Clean up tests that 
return a value that isn't None

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

This can be re-closed. Deprecation warnings raised by the test suite are being 
fixed in BPO-44980 which already has an open pull request.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Kolen Cheung

New submission from Kolen Cheung :

With Python 3.9.6 on macOS,

In a file all_bug.py,

```py
__all__ = ("ϵ",)
ϵ = "ϵ"
```

Then run `from all_bug import *`, resulted in

AttributeError: module 'all_bug' has no attribute 'ϵ'

This happens with some other unicode characters as well, but not all. I can 
provide them if needed.

Removing the `__all__` line will successfully import ϵ and be used.

--
messages: 400106
nosy: christian.kolen
priority: normal
severity: normal
status: open
title: `module has no attribute` when `__all__` includes certain unicode 
characters
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

As long as the cycles don't actually end in a crash or an infinite cycle, I 
think is fine to not include them in the contact.

Even if that were included I don't think is actually a problem. Many APIs in C 
or C++ require the user to not form cycles, for instance, shared pointers in 
the c++ stdlib.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44979] pathlib: support relative path construction

2021-08-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

To be clear, by "file", you mean python source file, or I guess .pyc file if 
only that exists. I can't say I've given it much thought. What about built-in 
modules? Or frozen modules?

I'm not sure this is a great idea. In general, we've frowned on code that uses 
sys._getframe, and in particular that looks arbitrarily up the stack.

At the very least, you should find out if other python implementations can use 
this function.

I suggest bringing this up on the python-ideas mailing list.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

What about __bytes__?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Eric V. Smith

Eric V. Smith  added the comment:

Python normalizes identifiers with NFKC (see PEP 3131):

>>> e0 = "ϵ"
>>> import unicodedata
>>> e1 = unicodedata.normalize("NFKC", e0)
>>> e0 == e1
False
>>> unicodedata.name(e0)
'GREEK LUNATE EPSILON SYMBOL'
>>> unicodedata.name(e1)
'GREEK SMALL LETTER EPSILON'

If you use GREEK SMALL LETTER EPSILON as your identifier, you should be okay.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Eric, I think you may have been too hasty to close this as "not a bug".

It has tripped people up before. See #41542 which has also been closed (I also 
think prematurely).

We normalise variable names with NFKC, so we should normalise the values in 
__all__ as well, at least when doing an import.

Note that this is different from #42680 where the right answer is just to 
document. We shouldn't normalise strings as dict keys.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'd be okay with changing it to a 3.11 enhancement to normalize elements of 
__all__, or maybe a request to change the documentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Dong-hee Na


Dong-hee Na  added the comment:

@guido

>>> issubclass(bytes, typing.SupportsBytes)
False

IMHO, supporting is reasonable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

So let’s add that in a separate PR.
-- 
--Guido (mobile)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2021-08-22 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 2.0 -> 3.0
pull_requests: +26358
pull_request: https://github.com/python/cpython/pull/27901

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-22 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +26359
pull_request: https://github.com/python/cpython/pull/27901

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2021-08-22 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests:  -26358

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-22 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Liu: Thanks!

Google zip also shows 674 files in this archive, so it appears that it's not a 
Python-only issue. Can you test it with a few zip programs, ideally on a 2 or 
more platforms, and check which of them report more than 674 files?

(I simply opened the google drive link and google showed the listing and the 
total # of 674 files)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >