[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Guido van Rossum
Guido van Rossum added the comment: This is as intended. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Manjusaka
Change by Manjusaka : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Manjusaka
Manjusaka added the comment: > Augmented assignment behaves identically to the update method called with a > single positional argument, so it also accepts anything implementing the > Mapping protocol (more specifically, anything with the keys and __getitem__ > methods) or iterables of

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Manjusaka
Manjusaka added the comment: In my opinion, make more lenient or not is OK, but we should guarantee the magic method should keep clean and right meaning For example, the __iadd__ in std data structure should be as same as the __add__ except it's an in-place operator. If it's necessary, I

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > Augmented assignment behaves identically to the update method called with a > single positional argument, so it also accepts anything implementing the > Mapping protocol (more specifically, anything with the keys and __getitem__ > methods) or

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is how PEP 584 specifies it. The in-place operator is more lenient. It corresponds the behavior of list operators. >>> x = [] >>> y = (1, 2) >>> x + y Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate list (not

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +brandtbucher, gvanrossum, steven.daprano ___ Python tracker ___ ___ Python-bugs-list

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Manjusaka
New submission from Manjusaka : Hello Guys: I have tried Python 3.9.0a4, I have an issue: the __ior__ and the __or__ have different behavior For example: x={} y=[(1,2)] x|=y is right and x=x|y will raise an exception. I think it's should be better make the same between two magic method ?