@@ -473,42 +473,42 @@ \section{The standard type hierarchy\label{types}}
473473Special attributes:
474474
475475\begin {tableiii }{lll}{member}{Attribute}{Meaning}{}
476- \lineiii {func_doc }{The function's documentation string, or
476+ \lineiii {__doc__ }{The function's documentation string, or
477477 \code {None} if unavailable}{Writable}
478478
479- \lineiii {__doc__}{Another way of spelling
480- \member {func_doc}}{Writable}
481-
482- \lineiii {func_name}{The function's name}{Writable}
483-
484- \lineiii {__name__}{Another way of spelling
485- \member {func_name}}{Writable}
479+ \lineiii {__name__}{The function's name}{Writable}
486480
487481 \lineiii {__module__}{The name of the module the function was defined
488482 in, or \code {None} if unavailable.}{Writable}
489483
490- \lineiii {func_defaults }{A tuple containing default argument values
484+ \lineiii {__defaults__ }{A tuple containing default argument values
491485 for those arguments that have defaults, or \code {None} if no
492486 arguments have a default value}{Writable}
493487
494- \lineiii {func_code }{The code object representing the compiled
488+ \lineiii {__code__ }{The code object representing the compiled
495489 function body.}{Writable}
496490
497- \lineiii {func_globals }{A reference to the dictionary that holds the
491+ \lineiii {__globals__ }{A reference to the dictionary that holds the
498492 function's global variables --- the global namespace of the module
499493 in which the function was defined.}{Read-only}
500494
501- \lineiii {func_dict }{The namespace supporting arbitrary function
495+ \lineiii {__dict__ }{The namespace supporting arbitrary function
502496 attributes.}{Writable}
503497
504- \lineiii {func_closure }{\code {None} or a tuple of cells that contain
498+ \lineiii {__closure__ }{\code {None} or a tuple of cells that contain
505499 bindings for the function's free variables.}{Read-only}
500+
501+ \lineiii {__annotations__}{A dict containing annotations of parameters.}
502+ {Writable}
503+
504+ \lineiii {__kwdefaults__}{A dict containing defaults for keyword-only
505+ parameters.}{Writable}
506506\end {tableiii }
507507
508508Most of the attributes labelled `` Writable'' check the type of the
509509assigned value.
510510
511- \versionchanged [\code {func_name } is now writable]{2.4}
511+ \versionchanged [\code {__name__ } is now writable]{2.4}
512512
513513Function objects also support getting and setting arbitrary
514514attributes, which can be used, for example, to attach metadata to
@@ -521,16 +521,16 @@ \section{The standard type hierarchy\label{types}}
521521from its code object; see the description of internal types below.
522522
523523\withsubitem {(function attribute)}{
524- \ttindex {func_doc}
525524 \ttindex {__doc__}
526525 \ttindex {__name__}
527526 \ttindex {__module__}
528527 \ttindex {__dict__}
529- \ttindex {func_defaults}
530- \ttindex {func_closure}
531- \ttindex {func_code}
532- \ttindex {func_globals}
533- \ttindex {func_dict}}
528+ \ttindex {__defaults__}
529+ \ttindex {__closure__}
530+ \ttindex {__code__}
531+ \ttindex {__globals__}
532+ \ttindex {__annotations__}
533+ \ttindex {__kwdefaults__}
534534\indexii {global}{namespace}
535535
536536\item [User-defined methods]
@@ -700,7 +700,7 @@ \section{The standard type hierarchy\label{types}}
700700section~\ref {import }, `` The \keyword {import} statement'' ).%
701701\stindex {import}\obindex {module}
702702A module object has a namespace implemented by a dictionary object
703- (this is the dictionary referenced by the func_globals attribute of
703+ (this is the dictionary referenced by the __globals__ attribute of
704704functions defined in the module). Attribute references are translated
705705to lookups in this dictionary, e.g., \code {m.x} is equivalent to
706706\code {m.__dict__["x"]}.
0 commit comments