comparison Doc/texinputs/python.sty @ 17778:b4b3657cb1fa legacy-trunk

Define a new environment, classdesc*, which can be used to document a class without providing any information about the constructor. This should be used for classes which only exist to act as containers rather than as factories for instances.
author Fred Drake <fdrake@acm.org>
date Fri, 11 May 2001 01:00:30 +0000
parents db928a277f8b
children c25876a51f1b
comparison
equal deleted inserted replaced
17777:0ebb91521ae6 17778:b4b3657cb1fa
621 \begin{fulllineitems} 621 \begin{fulllineitems}
622 \item[\strong{class }\code{\bfcode{#1}(\py@varvars{#2})}% 622 \item[\strong{class }\code{\bfcode{#1}(\py@varvars{#2})}%
623 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] 623 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}]
624 }{\end{fulllineitems}} 624 }{\end{fulllineitems}}
625 625
626 % \begin{classdesc*}{name}
627 \newenvironment{classdesc*}[1]{
628 % Using \renewcommand doesn't work for this, for unknown reasons:
629 \global\def\py@thisclass{#1}
630 \begin{fulllineitems}
631 \item[\strong{class }\code{\bfcode{#1}}%
632 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}]
633 }{\end{fulllineitems}}
634
626 % \begin{excclassdesc}{name}{constructor args} 635 % \begin{excclassdesc}{name}{constructor args}
627 % but indexes as an exception 636 % but indexes as an exception
628 \newenvironment{excclassdesc}[2]{ 637 \newenvironment{excclassdesc}[2]{
629 % Using \renewcommand doesn't work for this, for unknown reasons: 638 % Using \renewcommand doesn't work for this, for unknown reasons:
630 \global\def\py@thisclass{#1} 639 \global\def\py@thisclass{#1}
631 \begin{fulllineitems} 640 \begin{fulllineitems}
632 \item[\strong{exception }\code{\bfcode{#1}(\py@varvars{#2})}% 641 \item[\strong{exception }\code{\bfcode{#1}(\py@varvars{#2})}%
633 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] 642 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}]
634 }{\end{fulllineitems}} 643 }{\end{fulllineitems}}
644
645 % There is no corresponding {excclassdesc*} environment. To describe
646 % a class exception without parameters, use the {excdesc} environment.
635 647
636 648
637 \let\py@classbadkey=\@undefined 649 \let\py@classbadkey=\@undefined
638 650
639 % object method ---------------------------------------------------------- 651 % object method ----------------------------------------------------------