Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(140)

Delta Between Two Patch Sets: Doc/library/sys.rst

Issue 2414: Add gc header size to returned sizeof information SVN Base: http://svn.python.org/view/*checkout*/python/trunk/
Left Patch Set: Added PyGC_Head to _testcapi required for testing. Created 1 year, 5 months ago
Right Patch Set: added a default return value and made this and the gc_head inclusion optional Created 1 year, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 1
2 :mod:`sys` --- System-specific parameters and functions 2 :mod:`sys` --- System-specific parameters and functions
3 ======================================================= 3 =======================================================
4 4
5 .. module:: sys 5 .. module:: sys
6 :synopsis: Access system-specific parameters and functions. 6 :synopsis: Access system-specific parameters and functions.
7 7
8 8
9 This module provides access to some variables used or maintained by the 9 This module provides access to some variables used or maintained by the
10 interpreter and to functions that interact strongly with the interpreter. It is 10 interpreter and to functions that interact strongly with the interpreter. It is
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 403
404 .. function:: getrecursionlimit() 404 .. function:: getrecursionlimit()
405 405
406 Return the current value of the recursion limit, the maximum depth of the Pyt hon 406 Return the current value of the recursion limit, the maximum depth of the Pyt hon
407 interpreter stack. This limit prevents infinite recursion from causing an 407 interpreter stack. This limit prevents infinite recursion from causing an
408 overflow of the C stack and crashing Python. It can be set by 408 overflow of the C stack and crashing Python. It can be set by
409 :func:`setrecursionlimit`. 409 :func:`setrecursionlimit`.
410 410
411 411
412 .. function:: getsizeof(object) 412 .. function:: getsizeof(object[, default][, gc_head=True])
Martin v. Löwis 2008/07/07 05:24:06 I would like to reconsider the addition of the gc_
413 413
414 Return the size of an object in bytes. The object can be any type of 414 Return the size of an object in bytes. The object can be any type of
415 object. All built-in objects will return correct results, but this 415 object. All built-in objects will return correct results, but this
416 does not have to hold true for third-party extensions as it is implementation 416 does not have to hold true for third-party extensions as it is implementation
417 specific. 417 specific.
418 418
419 func:`getsizeof` calls the object's __sizeof__ method and add's an additional 419 The *default* argument allows to define a value which will be returned
Martin v. Löwis 2008/06/26 18:05:31 add's -> adds
420 if the object type does not provide means to retrieve the size and would
421 cause a `TypeError`.
422
423 func:`getsizeof` calls the object's __sizeof__ method and adds an additional
420 garbage collector overhead if the object is managed by the garbage collector. 424 garbage collector overhead if the object is managed by the garbage collector.
425 The *gc_head* argument allows to turn off the inclusion of this overhead
426 in the returned result.
421 427
422 .. versionadded:: 2.6 428 .. versionadded:: 2.6
423 429
424 430
425 .. function:: _getframe([depth]) 431 .. function:: _getframe([depth])
426 432
427 Return a frame object from the call stack. If optional integer *depth* is 433 Return a frame object from the call stack. If optional integer *depth* is
428 given, return the frame object that many calls below the top of the stack. I f 434 given, return the frame object that many calls below the top of the stack. I f
429 that is deeper than the call stack, :exc:`ValueError` is raised. The default 435 that is deeper than the call stack, :exc:`ValueError` is raised. The default
430 for *depth* is zero, returning the frame at the top of the call stack. 436 for *depth* is zero, returning the frame at the top of the call stack.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 first three characters of :const:`version`. It is provided in the :mod:`sys` 838 first three characters of :const:`version`. It is provided in the :mod:`sys`
833 module for informational purposes; modifying this value has no effect on the 839 module for informational purposes; modifying this value has no effect on the
834 registry keys used by Python. Availability: Windows. 840 registry keys used by Python. Availability: Windows.
835 841
836 842
837 .. seealso:: 843 .. seealso::
838 844
839 Module :mod:`site` 845 Module :mod:`site`
840 This describes how to use .pth files to extend ``sys.path``. 846 This describes how to use .pth files to extend ``sys.path``.
841 847
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r497