[Python-checkins] cpython: Issue #23530: fix clinic comment.

charles-francois.natali python-checkins at python.org
Thu Aug 13 21:37:28 CEST 2015


https://hg.python.org/cpython/rev/23c6cc5d5b8f
changeset: 97372:23c6cc5d5b8f
user: Charles-François Natali <cf.natali at gmail.com>
date: Thu Aug 13 20:37:08 2015 +0100
summary:
 Issue #23530: fix clinic comment.
files:
 Modules/clinic/posixmodule.c.h | 10 +++++++---
 Modules/posixmodule.c | 12 +++++++-----
 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -2116,7 +2116,7 @@
 "sched_getaffinity($module, pid, /)\n"
 "--\n"
 "\n"
-"Return the affinity of the process identified by pid.\n"
+"Return the affinity of the process identified by pid (or the current process if zero).\n"
 "\n"
 "The affinity is returned as a set of CPU identifiers.");
 
@@ -5178,7 +5178,11 @@
 "cpu_count($module, /)\n"
 "--\n"
 "\n"
-"Return the number of CPUs in the system; return None if indeterminable.");
+"Return the number of CPUs in the system; return None if indeterminable.\n"
+"\n"
+"This number is not equivalent to the number of CPUs the current process can\n"
+"use. The number of usable CPUs can be obtained with\n"
+"``len(os.sched_getaffinity(0))``");
 
 #define OS_CPU_COUNT_METHODDEF \
 {"cpu_count", (PyCFunction)os_cpu_count, METH_NOARGS, os_cpu_count__doc__},
@@ -5788,4 +5792,4 @@
 #ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
 #define OS_SET_HANDLE_INHERITABLE_METHODDEF
 #endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
-/*[clinic end generated code: output=f3f92b2d2e2c3fe3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=35b50461dbecd65d input=a9049054013a1b77]*/
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5767,7 +5767,7 @@
 
 static PyObject *
 os_sched_getaffinity_impl(PyModuleDef *module, pid_t pid)
-/*[clinic end generated code: output=b431a8f310e369e7 input=eaf161936874b8a1]*/
+/*[clinic end generated code: output=b431a8f310e369e7 input=983ce7cb4a565980]*/
 {
 int cpu, ncpus, count;
 size_t setsize;
@@ -11201,14 +11201,16 @@
 /*[clinic input]
 os.cpu_count
 
-Return the number of CPUs in the system; return None if indeterminable. This
-number is not equivalent to the number of CPUs the current process can use.
-The number of usable CPUs can be obtained with ``len(os.sched_getaffinity(0))``
+Return the number of CPUs in the system; return None if indeterminable.
+
+This number is not equivalent to the number of CPUs the current process can
+use. The number of usable CPUs can be obtained with
+``len(os.sched_getaffinity(0))``
 [clinic start generated code]*/
 
 static PyObject *
 os_cpu_count_impl(PyModuleDef *module)
-/*[clinic end generated code: output=c59ee7f6bce832b8 input=d55e2f8f3823a628]*/
+/*[clinic end generated code: output=c59ee7f6bce832b8 input=e7c8f4ba6dbbadd3]*/
 {
 int ncpu = 0;
 #ifdef MS_WINDOWS
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

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