[Python-checkins] r69354 - in python/branches/py3k: Doc/library/itertools.rst Lib/tkinter/test/runtktests.py Lib/tkinter/test/test_ttk/test_extensions.py

benjamin.peterson python-checkins at python.org
Fri Feb 6 04:01:25 CET 2009


Author: benjamin.peterson
Date: Fri Feb 6 04:01:24 2009
New Revision: 69354
Log:
Merged revisions 69141,69211-69212 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r69141 | benjamin.peterson | 2009年01月31日 14:01:48 -0600 (2009年1月31日) | 1 line
 
 fix indentation
........
 r69211 | guilherme.polo | 2009年02月02日 14:23:29 -0600 (2009年2月02日) | 1 line
 
 Restore the previous geometry before leaving the test
........
 r69212 | guilherme.polo | 2009年02月02日 14:28:59 -0600 (2009年2月02日) | 1 line
 
 Moving to importlib
........
Modified:
 python/branches/py3k/ (props changed)
 python/branches/py3k/Doc/library/itertools.rst
 python/branches/py3k/Lib/tkinter/test/runtktests.py
 python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py
Modified: python/branches/py3k/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k/Doc/library/itertools.rst	(original)
+++ python/branches/py3k/Doc/library/itertools.rst	Fri Feb 6 04:01:24 2009
@@ -654,26 +654,26 @@
 s = list(iterable)
 return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
 
- def unique_everseen(iterable, key=None):
- "List unique elements, preserving order. Remember all elements ever seen."
- # unique_everseen('AAAABBBCCDAABBB') --> A B C D
- # unique_everseen('ABBCcAD', str.lower) --> A B C D
- seen = set()
- seen_add = seen.add
- if key is None:
- for element in iterable:
- if element not in seen:
- seen_add(element)
- yield element
- else:
- for element in iterable:
- k = key(element)
- if k not in seen:
- seen_add(k)
- yield element
+ def unique_everseen(iterable, key=None):
+ "List unique elements, preserving order. Remember all elements ever seen."
+ # unique_everseen('AAAABBBCCDAABBB') --> A B C D
+ # unique_everseen('ABBCcAD', str.lower) --> A B C D
+ seen = set()
+ seen_add = seen.add
+ if key is None:
+ for element in iterable:
+ if element not in seen:
+ seen_add(element)
+ yield element
+ else:
+ for element in iterable:
+ k = key(element)
+ if k not in seen:
+ seen_add(k)
+ yield element
 
- def unique_justseen(iterable, key=None):
- "List unique elements, preserving order. Remember only the element just seen."
- # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
- # unique_justseen('ABBCcAD', str.lower) --> A B C A D
- return map(next, map(itemgetter(1), groupby(iterable, key)))
+ def unique_justseen(iterable, key=None):
+ "List unique elements, preserving order. Remember only the element just seen."
+ # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
+ # unique_justseen('ABBCcAD', str.lower) --> A B C A D
+ return map(next, imap(itemgetter(1), groupby(iterable, key)))
Modified: python/branches/py3k/Lib/tkinter/test/runtktests.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/test/runtktests.py	(original)
+++ python/branches/py3k/Lib/tkinter/test/runtktests.py	Fri Feb 6 04:01:24 2009
@@ -9,6 +9,7 @@
 import os
 import sys
 import unittest
+import importlib
 import test.support
 
 this_dir_path = os.path.abspath(os.path.dirname(__file__))
@@ -44,13 +45,8 @@
 
 for name in filenames:
 try:
- yield __import__(
- "%s.%s.%s" % (
- "tkinter.test",
- pkg_name,
- name[:-len(py_ext)]),
- fromlist=['']
- )
+ yield importlib.import_module(
+ ".%s" % name[:-len(py_ext)], pkg_name)
 except test.support.ResourceDenied:
 if gui:
 raise
Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py	(original)
+++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py	Fri Feb 6 04:01:24 2009
@@ -167,14 +167,15 @@
 x.update()
 
 width, height = x.master.winfo_width(), x.master.winfo_height()
- width, height = width * 2, height * 2
+ width_new, height_new = width * 2, height * 2
 
 x.value = 3
 x.update()
- x.master.wm_geometry("%dx%d" % (width, height))
+ x.master.wm_geometry("%dx%d" % (width_new, height_new))
 self.failUnlessEqual(int(x.label.place_info()['x']),
 x.scale.coords()[0])
 
+ # Reset geometry
 x.master.wm_geometry("%dx%d" % (width, height))
 x.destroy()
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /