Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d3fb8a

Browse files
committed
Merged revisions 59107-59186 via svnmerge from
svn+ssh://[email protected]/python/trunk (Note: some conflicts in the PCbuild9 directory reverted. Sorry Christian!) ........ r59120 | christian.heimes | 2007-11-22 03:21:16 -0800 (Thu, 22 Nov 2007) | 3 lines Backport of the PCbuild9 directory from the py3k branch. I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k. Have fun! :) ........ r59126 | brett.cannon | 2007-11-22 16:06:51 -0800 (Thu, 22 Nov 2007) | 2 lines Fix a bug in the test for using __loader__.get_data(). ........ r59131 | christian.heimes | 2007-11-22 23:05:03 -0800 (Thu, 22 Nov 2007) | 1 line Backport of PCbuild9 fixes from py3k r59130 ........ r59132 | christian.heimes | 2007-11-23 01:10:36 -0800 (Fri, 23 Nov 2007) | 2 lines Applied patch #1754273 and #1754271 from Thomas Glee The patches are adding deprecation warnings for back ticks and <> ........ r59133 | christian.heimes | 2007-11-23 04:12:02 -0800 (Fri, 23 Nov 2007) | 2 lines Fixed problems in the last commit. Filenames and line numbers weren't reported correctly. Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name. ........ r59134 | christian.heimes | 2007-11-23 04:16:35 -0800 (Fri, 23 Nov 2007) | 1 line How did the comment get there? ........ r59135 | christian.heimes | 2007-11-23 05:25:31 -0800 (Fri, 23 Nov 2007) | 1 line And yet another fix for the patch. Paul Moore has send me a note that I've missed a declaration. The additional code has moved the declaration in the middle of the block. ........ r59136 | andrew.kuchling | 2007-11-23 05:37:39 -0800 (Fri, 23 Nov 2007) | 1 line Add item ........ r59137 | skip.montanaro | 2007-11-23 09:08:35 -0800 (Fri, 23 Nov 2007) | 2 lines Make trace and doctest play nice together (issue 1429818). Will backport. ........ r59139 | skip.montanaro | 2007-11-23 09:12:47 -0800 (Fri, 23 Nov 2007) | 1 line issue 1429818 ........ r59144 | facundo.batista | 2007-11-23 09:59:00 -0800 (Fri, 23 Nov 2007) | 10 lines Major change in the internal structure of the Decimal number: now it does not store the mantissa as a tuple of numbers, but as a string. This avoids a lot of conversions, and achieves a speedup of 40%. The API remains intact. Thanks Mark Dickinson. ........ r59146 | facundo.batista | 2007-11-23 10:14:50 -0800 (Fri, 23 Nov 2007) | 3 lines Test cases from Cowlishaw, v2.57. All are pased cleanly. ........ r59156 | christian.heimes | 2007-11-23 17:36:02 -0800 (Fri, 23 Nov 2007) | 2 lines Added filename to compiling struct based on Martin's suggestion. I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious. ........ r59158 | christian.heimes | 2007-11-23 17:53:59 -0800 (Fri, 23 Nov 2007) | 2 lines Backport of fixes from py3k branch svn merge -r59131:HEAD ../../py3k/PCbuild9/ . ........ r59159 | skip.montanaro | 2007-11-23 20:29:08 -0800 (Fri, 23 Nov 2007) | 1 line revert change that breaks test_doctest (which I forgot to run - sorry) ........ r59162 | skip.montanaro | 2007-11-23 20:31:15 -0800 (Fri, 23 Nov 2007) | 1 line revert ........ r59164 | georg.brandl | 2007-11-24 03:31:46 -0800 (Sat, 24 Nov 2007) | 3 lines #1344: document that you need to open std{in,out,err} with PIPE if you want communicate() to work as described. ........ r59165 | georg.brandl | 2007-11-24 03:39:13 -0800 (Sat, 24 Nov 2007) | 2 lines #1467: fix documentation for TestResult.add{Error,Failure}. ........ r59166 | georg.brandl | 2007-11-24 03:42:14 -0800 (Sat, 24 Nov 2007) | 2 lines #1355: remove mention of PyXML from xml.dom docs. ........ r59169 | amaury.forgeotdarc | 2007-11-24 05:20:22 -0800 (Sat, 24 Nov 2007) | 2 lines Warning "<> not supported in 3.x" should be enabled only when the -3 option is set. ........ r59170 | amaury.forgeotdarc | 2007-11-24 05:44:17 -0800 (Sat, 24 Nov 2007) | 3 lines Issue #1445: Fix a SystemError when accessing the ``cell_contents`` attribute of an empty cell object. Now a ValueError is raised. ........ r59172 | georg.brandl | 2007-11-24 05:56:09 -0800 (Sat, 24 Nov 2007) | 3 lines #1735632: add O_NOATIME constant to os module. Also document a few other O_ constants that were missing from documentation. ........ r59173 | skip.montanaro | 2007-11-24 06:30:47 -0800 (Sat, 24 Nov 2007) | 1 line back in these go - thanks to Titus Brown for the fix ........ r59176 | martin.v.loewis | 2007-11-24 10:33:40 -0800 (Sat, 24 Nov 2007) | 2 lines Bug #1494: Document that appendChild removes first. ........ r59186 | guido.van.rossum | 2007-11-26 14:16:49 -0800 (Mon, 26 Nov 2007) | 2 lines A thread-less variant of brownian.py, submitted by Michele Simoniato. ........
1 parent 4975a1f commit 0d3fb8a

157 files changed

Lines changed: 862 additions & 491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Demo/tkinter/guido/brownian2.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Brownian motion -- an example of a NON multi-threaded Tkinter program ;)
2+
# By Michele Simoniato, inspired by brownian.py
3+
4+
from Tkinter import *
5+
import random
6+
import sys
7+
8+
WIDTH = 400
9+
HEIGHT = 300
10+
SIGMA = 10
11+
BUZZ = 2
12+
RADIUS = 2
13+
LAMBDA = 10
14+
FILL = 'red'
15+
16+
stop = 0 # Set when main loop exits
17+
root = None # main window
18+
19+
def particle(canvas): # particle = iterator over the moves
20+
r = RADIUS
21+
x = random.gauss(WIDTH/2.0, SIGMA)
22+
y = random.gauss(HEIGHT/2.0, SIGMA)
23+
p = canvas.create_oval(x-r, y-r, x+r, y+r, fill=FILL)
24+
while not stop:
25+
dx = random.gauss(0, BUZZ)
26+
dy = random.gauss(0, BUZZ)
27+
try:
28+
canvas.move(p, dx, dy)
29+
except TclError:
30+
break
31+
else:
32+
yield None
33+
34+
def move(particle): # move the particle at random time
35+
particle.next()
36+
dt = random.expovariate(LAMBDA)
37+
root.after(int(dt*1000), move, particle)
38+
39+
def main():
40+
global root, stop
41+
root = Tk()
42+
canvas = Canvas(root, width=WIDTH, height=HEIGHT)
43+
canvas.pack(fill='both', expand=1)
44+
np = 30
45+
if sys.argv[1:]:
46+
np = int(sys.argv[1])
47+
for i in range(np): # start the dance
48+
move(particle(canvas))
49+
try:
50+
root.mainloop()
51+
finally:
52+
stop = 1
53+
54+
if __name__ == '__main__':
55+
main()

Doc/library/os.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,7 @@ platforms. For descriptions of their availability and use, consult
597597

598598

599599
.. data:: O_BINARY
600-
601-
Option for the *flag* argument to the :func:`open` function. This can be
602-
bit-wise OR'd together with those listed above. Availability: Windows.
603-
604-
.. % XXX need to check on the availability of this one.
605-
606-
607-
.. data:: O_NOINHERIT
600+
O_NOINHERIT
608601
O_SHORT_LIVED
609602
O_TEMPORARY
610603
O_RANDOM
@@ -615,6 +608,15 @@ platforms. For descriptions of their availability and use, consult
615608
bit-wise OR'd together. Availability: Windows.
616609

617610

611+
.. data:: O_DIRECT
612+
O_DIRECTORY
613+
O_NOFOLLOW
614+
O_NOATIME
615+
616+
Options for the *flag* argument to the :func:`open` function. These are
617+
GNU extensions and not present if they are not defined by the C library.
618+
619+
618620
.. data:: SEEK_SET
619621
SEEK_CUR
620622
SEEK_END

Doc/library/subprocess.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ Instances of the :class:`Popen` class have the following methods:
189189

190190
communicate() returns a tuple (stdout, stderr).
191191

192-
.. note::
192+
Note that if you want to send data to the process's stdin, you need to create
193+
the Popen object with ``stdin=PIPE``. Similarly, to get anything other than
194+
``None`` in the result tuple, you need to give ``stdout=PIPE`` and/or
195+
``stderr=PIPE`` too.
196+
197+
.. note::
193198

194199
The data read is buffered in memory, so do not use this method if the data size
195200
is large or unlimited.

Doc/library/unittest.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,17 +804,19 @@ tools which support interactive reporting while tests are being run.
804804
Called when the test case *test* raises an unexpected exception *err* is a tuple
805805
of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``.
806806

807-
The default implementation appends ``(test, err)`` to the instance's ``errors``
808-
attribute.
807+
The default implementation appends a tuple ``(test, formatted_err)`` to the
808+
instance's ``errors`` attribute, where *formatted_err* is a formatted
809+
traceback derived from *err*.
809810

810811

811812
.. method:: TestResult.addFailure(test, err)
812813

813814
Called when the test case *test* signals a failure. *err* is a tuple of the form
814815
returned by :func:`sys.exc_info`: ``(type, value, traceback)``.
815816

816-
The default implementation appends ``(test, err)`` to the instance's
817-
``failures`` attribute.
817+
The default implementation appends a tuple ``(test, formatted_err)`` to the
818+
instance's ``failures`` attribute, where *formatted_err* is a formatted
819+
traceback derived from *err*.
818820

819821

820822
.. method:: TestResult.addSuccess(test)

Doc/library/xml.dom.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ representation for XML data.
2929

3030
The Document Object Model is being defined by the W3C in stages, or "levels" in
3131
their terminology. The Python mapping of the API is substantially based on the
32-
DOM Level 2 recommendation. The mapping of the Level 3 specification, currently
33-
only available in draft form, is being developed by the `Python XML Special
34-
Interest Group <http://www.python.org/sigs/xml-sig/>`_ as part of the `PyXML
35-
package <http://pyxml.sourceforge.net/>`_. Refer to the documentation bundled
36-
with that package for information on the current state of DOM Level 3 support.
32+
DOM Level 2 recommendation.
33+
34+
.. XXX PyXML is dead...
35+
.. The mapping of the Level 3 specification, currently
36+
only available in draft form, is being developed by the `Python XML Special
37+
Interest Group <http://www.python.org/sigs/xml-sig/>`_ as part of the `PyXML
38+
package <http://pyxml.sourceforge.net/>`_. Refer to the documentation bundled
39+
with that package for information on the current state of DOM Level 3 support.
3740
3841
.. % What if your needs are somewhere between SAX and the DOM? Perhaps
3942
.. % you cannot afford to load the entire tree in memory but you find the
@@ -74,10 +77,6 @@ implementations are free to support the strict mapping from IDL). See section
7477
`Document Object Model (DOM) Level 1 Specification <http://www.w3.org/TR/REC-DOM-Level-1/>`_
7578
The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`.
7679

77-
`PyXML <http://pyxml.sourceforge.net>`_
78-
Users that require a full-featured implementation of DOM should use the PyXML
79-
package.
80-
8180
`Python Language Mapping Specification <http://www.omg.org/docs/formal/02-11-05.pdf>`_
8281
This specifies the mapping from OMG IDL to Python.
8382

@@ -364,8 +363,9 @@ All of the components of an XML document are subclasses of :class:`Node`.
364363

365364
.. method:: Node.appendChild(newChild)
366365

367-
Add a new child node to this node at the end of the list of children, returning
368-
*newChild*.
366+
Add a new child node to this node at the end of the list of
367+
children, returning *newChild*. If the node was already in
368+
in the tree, it is removed first.
369369

370370

371371
.. method:: Node.insertBefore(newChild, refChild)

Doc/whatsnew/2.6.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,10 @@ Build and C API Changes
872872

873873
Changes to Python's build process and to the C API include:
874874

875+
* Python 2.6 can be built with Microsoft Visual Studio 2008.
876+
See the :file:`PCbuild9` directory for the build files.
877+
(Implemented by Christian Heimes.)
878+
875879
* The BerkeleyDB module now has a C API object, available as
876880
``bsddb.db.api``. This object can be used by other C extensions
877881
that wish to use the :mod:`bsddb` module for their own purposes.

0 commit comments

Comments
 (0)