Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6421] errors in docs re module initialization vs self arg to functions

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 4, 2009, 3:53 PM

Post #1 of 2 (184 views)
Permalink
[issue6421] errors in docs re module initialization vs self arg to functions

New submission from Alex Martelli <aleaxit [at] gmail>:

http://docs.python.org/3.1/c-api/structures.html#PyMethodDef

says (under METH_VARARGS):

"""The first one is the self object for methods; for module functions,
it has the value given to Py_InitModule4 (or NULL if Py_InitModule was
used)."""

Py_InitModule4 is no more, and the first argument is now in fact a
pointer to the module object. This is quite important, since the module
object is now crucial for the get-state function that's supposed to
replace a module's statics!

http://docs.python.org/3.1/extending/extending.html#a-simple-example
is ever wronger, since it says, after presenting spam_system's code:

"""The self argument is only used when the C function implements a
built-in method, not a function. In the example, self will always be a
NULL pointer, since we are defining a function, not a method. """

It will never be NULL; it will point to the module.

----------
assignee: georg.brandl
components: Documentation
keywords: easy
messages: 90134
nosy: aleax, georg.brandl
priority: normal
severity: normal
status: open
title: errors in docs re module initialization vs self arg to functions
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6421>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 11, 2009, 3:43 AM

Post #2 of 2 (152 views)
Permalink
[issue6421] errors in docs re module initialization vs self arg to functions [In reply to]

Georg Brandl <georg [at] python> added the comment:

Fixed both instances in r73943.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6421>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.