[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Guido van Rossum


Change by Guido van Rossum :


--
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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 9045919bfa820379a66ea67219f79ef6d9ecab49 by Jelle Zijlstra in 
branch 'master':
bpo-43772: Fix TypeVar.__ror__ (GH-25339)
https://github.com/python/cpython/commit/9045919bfa820379a66ea67219f79ef6d9ecab49


--

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
keywords: +patch
nosy: +Jelle Zijlstra
nosy_count: 4.0 -> 5.0
pull_requests: +24074
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/25339

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-09 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yes.--
--Guido (mobile)

--

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-08 Thread Larry Hastings


New submission from Larry Hastings :

The implementation of the | operator for TypeVar objects is as follows:

def __or__(self, right):
return Union[self, right]

def __ror__(self, right):
return Union[self, right]

I think the implementation of __ror__ is ever-so-slightly inaccurate.  
Shouldn't it be this?

def __ror__(self, left):
return Union[left, self]

I assume this wouldn't affect runtime behavior, as unions are sets and are 
presumably unordered.  The only observable difference should be in the repr() 
(and only then if both are non-None), as this reverses the elements.  The repr 
for Union does preserve the order of the elements it contains, so it's visible 
to the user there.

--
components: Library (Lib)
messages: 390524
nosy: larry
priority: low
severity: normal
stage: test needed
status: open
title: Minor repr error in typing.TypeVar.__ror__()
type: behavior
versions: Python 3.10

___
Python tracker 

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