Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
67d1de10
Commit
67d1de10
authored
Jun 26, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bug #1511998] Various comments from Nick Coghlan; thanks!
parent
27b3317b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
Doc/whatsnew/whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+20
-18
No files found.
Doc/whatsnew/whatsnew25.tex
View file @
67d1de10
...
...
@@ -817,7 +817,7 @@ The new \module{contextlib} module provides some functions and a
decorator that are useful for writing objects for use with the
'
\keyword
{
with
}
' statement.
The decorator is called
\function
{
context
factory
}
, and lets you write
The decorator is called
\function
{
context
manager
}
, and lets you write
a single generator function instead of defining a new class. The generator
should yield exactly one value. The code up to the
\keyword
{
yield
}
will be executed as the
\method
{__
enter
__
()
}
method, and the value
...
...
@@ -831,9 +831,9 @@ Our database example from the previous section could be written
using this decorator as:
\begin{verbatim}
from contextlib import context
factory
from contextlib import context
manager
@context
factory
@context
manager
def db
_
transaction (connection):
cursor = connection.cursor()
try:
...
...
@@ -1748,11 +1748,12 @@ Konqueror, and elinks. (Contributed by Oleg Broytmann and Georg
Brandl.)
% Patch #754022
\item
Python's standard library no longer includes
a package named
\module
{
xml
}
; the library's XML-related package
has been renamed to
\module
{
xmlcore
}
. This means
it will always be possible to import the standard library's
XML support whether or not the PyXML package is installed.
\item
The standard library's XML-related package
has been renamed to
\module
{
xmlcore
}
. The
\module
{
xml
}
module will
now import either the
\module
{
xmlcore
}
or PyXML version of subpackages
such as
\module
{
xml.dom
}
. The renaming means it will always be
possible to import the standard library's XML support whether or not
the PyXML package is installed.
\item
The
\module
{
xmlrpclib
}
module now supports returning
\class
{
datetime
}
objects for the XML-RPC date type. Supply
...
...
@@ -2168,7 +2169,7 @@ wsgi_app = ...
host = ''
port = 8000
httpd = make
_
server(host, port, wsgi
_
app)
httpd =
simple
_
server.
make
_
server(host, port, wsgi
_
app)
httpd.serve
_
forever()
\end{verbatim}
...
...
@@ -2218,12 +2219,13 @@ assignment = ast.body[0]
for
_
loop = ast.body[1]
\end{verbatim}
No documentation has been written for the AST code yet. To start
learning about it, read the definition of the various AST nodes in
\file
{
Parser/Python.asdl
}
. A Python script reads this file and
generates a set of C structure definitions in
\file
{
Include/Python-ast.h
}
. The
\cfunction
{
PyParser
_
ASTFromString()
}
and
\cfunction
{
PyParser
_
ASTFromFile()
}
, defined in
No official documentation has been written for the AST code yet, but
\pep
{
339
}
discusses the design. To start learning about the code, read the
definition of the various AST nodes in
\file
{
Parser/Python.asdl
}
. A
Python script reads this file and generates a set of C structure
definitions in
\file
{
Include/Python-ast.h
}
. The
\cfunction
{
PyParser
_
ASTFromString()
}
and
\cfunction
{
PyParser
_
ASTFromFile()
}
, defined in
\file
{
Include/pythonrun.h
}
, take Python source as input and return the
root of an AST representing the contents. This AST can then be turned
into a code object by
\cfunction
{
PyAST
_
Compile()
}
. For more
...
...
@@ -2406,8 +2408,8 @@ freed with the corresponding family's \cfunction{*_Free()} function.
The author would like to thank the following people for offering
suggestions, corrections and assistance with various drafts of this
article:
Phillip J. Eby, "Ralf W. Grosse-Kunstleve, Kent Johnson,
Martin von~L
\"
owis, Fredrik Lundh, Gustavo Niemeyer, James Pryor, Mike
Rovner, Scott Weikart, Barry Warsaw, Thomas Wouters.
article:
Nick Coghlan, Phillip J. Eby, "Ralf W. Grosse-Kunstleve, Kent
Johnson, Martin von~L
\"
owis, Fredrik Lundh, Gustavo Niemeyer, James
Pryor, Mike
Rovner, Scott Weikart, Barry Warsaw, Thomas Wouters.
\end{document}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment