A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-February/012766.html below:

[Python-Dev] Curious comment in some old libraries

[Python-Dev] Curious comment in some old librariesFred L. Drake, Jr. fdrake@acm.org
Fri, 9 Feb 2001 15:03:13 -0500 (EST)
Eric S. Raymond writes:
 > string.py:# NB: split(s) is NOT the same as splitfields(s, ' ')!
 > string.py:    (split and splitfields are synonymous)
 > string.py:splitfields = split
 > 
 > It certainly looks to me as though the "NB" comment is out of date.
 > Is there some subtle and wicked reason it has not been removed?

  The comment is correct.  splitfields(s) is synonymous with split(s),
and splitfields(s, ' ') is synonymous with split(s, ' ').
  If the second arg is omitted, any stretch of whitespace is used as
the separator, but if ' ' is supplied, exactly one space is used to
split fields.
  split(s, None) is synonymous with split(s), splitfields(s), and
splitfields(s, None).


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations




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