GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — right operand's __radd__ method is ignored when the left operand is a NamedTuple (3.15.0a7) · Issue #146592 · python/cpython Closed as duplicate Closed as duplicate Copy link Labels type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:I'm seeing a regression in how an from typing import NamedTuple class T(NamedTuple): x: int class A: def __init__(self, *args): self.lst = list(args) def __radd__(self, other): return A(*self.lst, other) print(((1,)+A()).lst) # [(1,)] print((T(x=1)+A()).lst) # raises Traceback (most recent call last): File "/Users/clm/dev/gh/astropy/astropy/t.py", line 13, in <module> print((T(x=1)+A()).lst) # raises ~~~~~~^~~~ TypeError: can only concatenate tuple (not "A") to tuple The This was originally discovered in astropy's test suite. xref numpy/numpy#31088 CPython versions tested on:3.15 Operating systems tested on:Linux Reacted by Joren Hammudoglu Activity
MetadataMetadataAssigneesLabelstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |