On Jan 9, 2008 4:10 PM, christian.heimes <[email protected]> wrote: > Author: christian.heimes > Date: Thu Jan 10 01:10:02 2008 > New Revision: 59883 > > Log: > Merged revisions 59864-59882 via svnmerge from > svn+ssh://[EMAIL PROTECTED]/python/trunk > > ........ > --- python/branches/py3k/Doc/library/collections.rst (original) > +++ python/branches/py3k/Doc/library/collections.rst Thu Jan 10 01:10:02 > 2008 > @@ -510,7 +510,7 @@ > Point(x=33, y=22) > > >>> for partnum, record in inventory.items(): > - inventory[partnum] = record._replace(price=newprices[partnum], > timestamp=time.now()) > + ... inventory[partnum] = record._replace(price=newprices[partnum], > timestamp=time.now()) > > .. attribute:: somenamedtuple._fields > > @@ -525,7 +525,7 @@ > >>> Color = namedtuple('Color', 'red green blue') > >>> Pixel = namedtuple('Pixel', Point._fields + Color._fields) > >>> Pixel(11, 22, 128, 255, 0) > - Pixel(x=11, y=22, red=128, green=255, blue=0)' > + Pixel(x=11, y=22, red=128, green=255, blue=0) > > To retrieve a field whose name is stored in a string, use the :func:`getattr` > function:: > @@ -544,14 +544,14 @@ > a fixed-width print format:: > > >>> class Point(namedtuple('Point', 'x y')): > - @property > - def hypot(self): > - return (self.x ** 2 + self.y ** 2) ** 0.5 > - def __str__(self): > - return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, > self.hypot) > + ... @property > + ... def hypot(self): > + ... return (self.x ** 2 + self.y ** 2) ** 0.5 > + ... def __str__(self): > + ... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, > self.y, self.hypot) > > >>> for p in Point(3,4), Point(14,5), Point(9./7,6): > - print p > + ... print p
This print should be fixed so it works in 3k. n _______________________________________________ Python-3000-checkins mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000-checkins
