summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-02-11 21:32:43 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-02-11 21:32:43 (GMT)
commitf5b3e36493da275334e29afdbd238863697dca35 (patch)
tree9ddfdb941f79b23a7665f473df37f82f49a80981 /Lib
parentcbcdfdc1129cdec27281f62e4494a05405354340 (diff)
downloadcpython-f5b3e36493da275334e29afdbd238863697dca35.zip
cpython-f5b3e36493da275334e29afdbd238863697dca35.tar.gz
cpython-f5b3e36493da275334e29afdbd238863697dca35.tar.bz2
Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_iterlen.py4
-rw-r--r--Lib/test/test_set.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py
index 1770de2..bcd0a6f 100644
--- a/Lib/test/test_iterlen.py
+++ b/Lib/test/test_iterlen.py
@@ -55,7 +55,9 @@ def len(obj):
return _len(obj)
except TypeError:
try:
- return obj._length_cue()
+ # note: this is an internal undocumented API,
+ # don't rely on it in your own programs
+ return obj.__length_hint__()
except AttributeError:
raise TypeError
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index e26065c..6ff1215 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -607,7 +607,9 @@ class TestBasicOps(unittest.TestCase):
for v in self.set:
self.assert_(v in self.values)
setiter = iter(self.set)
- self.assertEqual(setiter._length_cue(), len(self.set))
+ # note: __length_hint__ is an internal undocumented API,
+ # don't rely on it in your own programs
+ self.assertEqual(setiter.__length_hint__(), len(self.set))
def test_pickling(self):
p = pickle.dumps(self.set)