A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/007853.html below:

[Python-Dev] printing xrange objects

[Python-Dev] printing xrange objectsFred L. Drake, Jr. fdrake@beopen.com
Thu, 3 Aug 2000 09:06:51 -0400 (EDT)
  At various points, there have been comments that xrange objects
should not print as lists but as xrange objects.  Taking a look at the
implementation, I noticed that if you call repr() (by name or by
backtick syntax), you get "the right thing"; the list representation
comes up when you print the object on a real file object.  The
tp_print slot of the xrange type produces the list syntax.  There is
no tp_str handler, so str(xrange(...)) is the same as
repr(xrange(...)).
  I propose ripping out the tp_print handler completely.  (And I've
already tested my patch. ;)
  Comments?


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at beopen.com>
BeOpen PythonLabs Team Member




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4