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

Skip to content

Commit 107690c

Browse files
committed
Merged revisions 76884-76885,76887,76889-76890,76895 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r76884 | georg.brandl | 2009-12-19 18:35:49 +0100 (Sa, 19 Dez 2009) | 9 lines Merged revisions 76883 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r76883 | georg.brandl | 2009-12-19 18:34:32 +0100 (Sa, 19 Dez 2009) | 1 line #7521: remove Py_GetBuildNumber(), which was removed in favor of Py_GetBuildInfo(). ........ ................ r76885 | georg.brandl | 2009-12-19 18:36:20 +0100 (Sa, 19 Dez 2009) | 1 line #7521: remove PyEval_GetRestricted() from the docs. ................ r76887 | georg.brandl | 2009-12-19 18:46:40 +0100 (Sa, 19 Dez 2009) | 9 lines Recorded merge of revisions 76886 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r76886 | georg.brandl | 2009-12-19 18:43:33 +0100 (Sa, 19 Dez 2009) | 1 line #7493: review of Design FAQ by Florent Xicluna. ........ ................ r76889 | georg.brandl | 2009-12-19 18:57:51 +0100 (Sa, 19 Dez 2009) | 1 line #7499: Review of Library FAQ by Florent Xicluna. ................ r76890 | georg.brandl | 2009-12-19 18:59:59 +0100 (Sa, 19 Dez 2009) | 1 line #7500: add "Python 3 review needed" comments and fix a few obvious errors. ................ r76895 | georg.brandl | 2009-12-19 19:23:28 +0100 (Sa, 19 Dez 2009) | 1 line #7380: Fix some str/bytearray/bytes issues in uuid docs and implementation. ................
1 parent c06f34f commit 107690c

11 files changed

Lines changed: 193 additions & 193 deletions

File tree

Doc/c-api/init.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,6 @@ Initialization, Finalization, and Threads
285285
modify its value. The value is available to Python code as :data:`sys.version`.
286286

287287

288-
.. cfunction:: const char* Py_GetBuildNumber()
289-
290-
Return a string representing the Subversion revision that this Python executable
291-
was built from. This number is a string because it may contain a trailing 'M'
292-
if Python was built from a mixed revision source tree.
293-
294-
295288
.. cfunction:: const char* Py_GetPlatform()
296289

297290
.. index:: single: platform (in module sys)

Doc/c-api/reflection.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ Reflection
2929
currently executing.
3030

3131

32-
.. cfunction:: int PyEval_GetRestricted()
33-
34-
If there is a current frame and it is executing in restricted mode, return true,
35-
otherwise false.
36-
37-
3832
.. cfunction:: const char* PyEval_GetFuncName(PyObject *func)
3933

4034
Return the name of *func* if it is a function, class or instance object, else the

Doc/faq/design.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ code breakage.
234234

235235
.. XXX talk about protocols?
236236
237-
Note that for string operations Python has moved from external functions (the
238-
``string`` module) to methods. However, ``len()`` is still a function.
237+
.. note::
238+
239+
For string operations, Python has moved from external functions (the
240+
``string`` module) to methods. However, ``len()`` is still a function.
239241

240242

241243
Why is join() a string method instead of a list or tuple method?
@@ -306,14 +308,15 @@ expensive. In versions of Python prior to 2.0 it was common to use this idiom::
306308
This only made sense when you expected the dict to have the key almost all the
307309
time. If that wasn't the case, you coded it like this::
308310

309-
if dict.has_key(key):
311+
if key in dict(key):
310312
value = dict[key]
311313
else:
312314
dict[key] = getvalue(key)
313315
value = dict[key]
314316

315-
(In Python 2.0 and higher, you can code this as ``value = dict.setdefault(key,
316-
getvalue(key))``.)
317+
For this specific case, you could also use ``value = dict.setdefault(key,
318+
getvalue(key))``, but only if the ``getvalue()`` call is cheap enough because it
319+
is evaluated in all cases.
317320

318321

319322
Why isn't there a switch or case statement in Python?
@@ -750,7 +753,7 @@ requested again. This is called "memoizing", and can be implemented like this::
750753

751754
# Callers will never provide a third parameter for this function.
752755
def expensive (arg1, arg2, _cache={}):
753-
if _cache.has_key((arg1, arg2)):
756+
if (arg1, arg2) in _cache:
754757
return _cache[(arg1, arg2)]
755758

756759
# Calculate the value

Doc/faq/extending.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Extending/Embedding FAQ
77
.. highlight:: c
88

99

10+
.. XXX need review for Python 3.
11+
12+
1013
Can I create my own functions in C?
1114
-----------------------------------
1215

@@ -53,8 +56,7 @@ with a tool such as `SWIG <http://www.swig.org>`_. `SIP
5356
<http://www.riverbankcomputing.co.uk/software/sip/>`__, `CXX
5457
<http://cxx.sourceforge.net/>`_ `Boost
5558
<http://www.boost.org/libs/python/doc/index.html>`_, or `Weave
56-
<http://www.scipy.org/Weave>`_ are also alternatives for wrapping
57-
C++ libraries.
59+
<http://www.scipy.org/Weave>`_ are also alternatives for wrapping C++ libraries.
5860

5961

6062
How can I execute arbitrary Python statements from C?
@@ -161,8 +163,8 @@ Sample code and use for catching stdout:
161163
...
162164
>>> import sys
163165
>>> sys.stdout = StdoutCatcher()
164-
>>> print 'foo'
165-
>>> print 'hello world!'
166+
>>> print('foo')
167+
>>> print('hello world!')
166168
>>> sys.stderr.write(sys.stdout.data)
167169
foo
168170
hello world!
@@ -199,7 +201,11 @@ begin by reading :ref:`the "Extending and Embedding" document
199201
whole lot of difference between C and C++ -- so the strategy of building a new
200202
Python type around a C structure (pointer) type will also work for C++ objects.
201203

202-
For C++ libraries, see :ref:`c-wrapper-software`.
204+
For C++ libraries, you can look at `SIP
205+
<http://www.riverbankcomputing.co.uk/sip/>`_, `CXX
206+
<http://cxx.sourceforge.net/>`_, `Boost
207+
<http://www.boost.org/libs/python/doc/index.html>`_, `Weave
208+
<http://www.scipy.org/Weave>`_ or `SWIG <http://www.swig.org>`_
203209

204210

205211
I added a module using the Setup file and the make fails; why?
@@ -468,12 +474,9 @@ checking the value of sys.maxunicode:
468474

469475
>>> import sys
470476
>>> if sys.maxunicode > 65535:
471-
... print 'UCS4 build'
477+
... print('UCS4 build')
472478
... else:
473-
... print 'UCS2 build'
479+
... print('UCS2 build')
474480

475481
The only way to solve this problem is to use extension modules compiled with a
476482
Python binary built using the same size for Unicode characters.
477-
478-
479-

Doc/faq/gui.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Graphic User Interface FAQ
66

77
.. contents::
88

9+
.. XXX need review for Python 3.
10+
11+
912
General GUI Questions
1013
=====================
1114

@@ -159,6 +162,3 @@ The most common cause is that the widget to which the binding applies doesn't
159162
have "keyboard focus". Check out the Tk documentation for the focus command.
160163
Usually a widget is given the keyboard focus by clicking in it (but not for
161164
labels; see the takefocus option).
162-
163-
164-

0 commit comments

Comments
 (0)