We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 022e642 commit 85c27ccCopy full SHA for 85c27cc
README.md
@@ -138,13 +138,15 @@ Named Tuple
138
-----------
139
```python
140
>>> Point = collections.namedtuple('Point', 'x y')
141
->>> a = Point(1, y=2)
+>>> p = Point(1, y=2)
142
Point(x=1, y=2)
143
->>> a.x
+>>> p[0]
144
1
145
->>> getattr(a, 'y')
+>>> p.x
146
+1
147
+>>> getattr(p, 'y')
148
2
->>> Point._fields
149
+>>> Point._fields # Or: p._fields
150
('x', 'y')
151
```
152
0 commit comments