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
275c8487
Commit
275c8487
authored
Oct 31, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
d1f2cb37
64085e30
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
21 deletions
+18
-21
Doc/c-api/sys.rst
Doc/c-api/sys.rst
+0
-6
Doc/data/refcounts.dat
Doc/data/refcounts.dat
+0
-4
Doc/extending/embedding.rst
Doc/extending/embedding.rst
+13
-8
Doc/library/ctypes.rst
Doc/library/ctypes.rst
+2
-2
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
+1
-1
No files found.
Doc/c-api/sys.rst
View file @
275c8487
...
...
@@ -61,12 +61,6 @@ accessible to C code. They all work with the current interpreter thread's
Return the object *name* from the :mod:`sys` module or *NULL* if it does
not exist, without setting an exception.
.. c:function:: FILE *PySys_GetFile(char *name, FILE *def)
Return the :c:type:`FILE*` associated with the object *name* in the
:mod:`sys` module, or *def* if *name* is not in the module or is not associated
with a :c:type:`FILE*`.
.. c:function:: int PySys_SetObject(char *name, PyObject *v)
Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which
...
...
Doc/data/refcounts.dat
View file @
275c8487
...
...
@@ -1310,10 +1310,6 @@ PySys_AddWarnOption:char*:s::
PySys_AddXOption:void:::
PySys_AddXOption:const wchar_t*:s::
PySys_GetFile:FILE*:::
PySys_GetFile:char*:name::
PySys_GetFile:FILE*:def::
PySys_GetObject:PyObject*::0:
PySys_GetObject:char*:name::
...
...
Doc/extending/embedding.rst
View file @
275c8487
...
...
@@ -58,6 +58,7 @@ perform some operation on a file. ::
int
main(int argc, char *argv[])
{
Py_SetProgramName(argv[0]); /* optional but recommended */
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print('Today is', ctime(time()))\n");
...
...
@@ -65,14 +66,18 @@ perform some operation on a file. ::
return 0;
}
The above code first initializes the Python interpreter with
:c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script
that print the date and time. Afterwards, the :c:func:`Py_Finalize` call shuts
the interpreter down, followed by the end of the program. In a real program,
you may want to get the Python script from another source, perhaps a text-editor
routine, a file, or a database. Getting the Python code from a file can better
be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the
trouble of allocating memory space and loading the file contents.
Function :c:func:`Py_SetProgramName` should be called before
:c:func:`Py_Initialize` to inform the interpreter about paths to
Python run-time libraries. Next initialize the Python interpreter
with :c:func:`Py_Initialize`, followed by the execution of a
hard-coded Python script that prints the date and time. Afterwards,
the :c:func:`Py_Finalize` call shuts the interpreter down, followed by
the end of the program. In a real program, you may want to get the
Python script from another source, perhaps a text-editor routine, a
file, or a database. Getting the Python code from a file can better
be done by using the :c:func:`PyRun_SimpleFile` function, which saves
you the trouble of allocating memory space and loading the file
contents.
.. _lower-level-embedding:
...
...
Doc/library/ctypes.rst
View file @
275c8487
...
...
@@ -1155,8 +1155,8 @@ testing. Try it out with ``import __hello__`` for example.
Surprises
^^^^^^^^^
There are some edges in :mod:`ctypes` where you m
ay be expect something else than
what actually happens.
There are some edges in :mod:`ctypes` where you m
ight expect something other
than
what actually happens.
Consider the following example::
...
...
Misc/NEWS
View file @
275c8487
...
...
@@ -61,6 +61,8 @@ Core and Builtins
- Issue #15368: An issue that caused bytecode generation to be
non-deterministic when using randomized hashing (-R) has been fixed.
- Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
- Issue #15020: The program name used to search for Python's path is now
"python3" under Unix, not "python".
...
...
Modules/_collectionsmodule.c
View file @
275c8487
...
...
@@ -1019,7 +1019,7 @@ static PyMethodDef deque_methods[] = {
};
PyDoc_STRVAR
(
deque_doc
,
"deque(
iterable[, maxlen
]) --> deque object
\n
\
"deque(
[iterable[, maxlen]
]) --> deque object
\n
\
\n
\
Build an ordered collection with optimized access from its endpoints."
);
...
...
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