comparison Doc/texinputs/python.sty @ 14490:f78f287b3add legacy-trunk

excclassdesc: New environment. For use in documenting class-based exceptions which have interesting constructor signatures. \pep, \seepep: New macros. Equivalent to \rfc and \seerfc, but referring to the PEP series instead of the Internet RFC series of documents.
author Fred Drake <fdrake@acm.org>
date Sat, 09 Sep 2000 06:01:25 +0000
parents b4b2612ea333
children 9fed4eebc586
comparison
equal deleted inserted replaced
14489:52a600b38f7e 14490:f78f287b3add
599 \begin{fulllineitems} 599 \begin{fulllineitems}
600 \item[\code{\bfcode{#1}(\py@varvars{#2})}% 600 \item[\code{\bfcode{#1}(\py@varvars{#2})}%
601 \withsubitem{(class in \py@thismodule)}{\ttindex{#1}}] 601 \withsubitem{(class in \py@thismodule)}{\ttindex{#1}}]
602 }{\end{fulllineitems}} 602 }{\end{fulllineitems}}
603 603
604 % \begin{excclassdesc}{name}{constructor args}
605 % but indexes as an exception
606 \newenvironment{excclassdesc}[2]{
607 % Using \renewcommand doesn't work for this, for unknown reasons:
608 \global\def\py@thisclass{#1}
609 \begin{fulllineitems}
610 \item[\code{\bfcode{#1}(\py@varvars{#2})}%
611 \withsubitem{(exception in \py@thismodule)}{\ttindex{#1}}]
612 }{\end{fulllineitems}}
613
604 614
605 \let\py@classbadkey=\@undefined 615 \let\py@classbadkey=\@undefined
606 616
607 % object method ---------------------------------------------------------- 617 % object method ----------------------------------------------------------
608 % \begin{methoddesc}[classname]{methodname}{args} 618 % \begin{methoddesc}[classname]{methodname}{args}
801 811
802 % constants defined in Python modules or C headers, not language constants: 812 % constants defined in Python modules or C headers, not language constants:
803 \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic 813 \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic
804 814
805 \newcommand{\manpage}[2]{{\emph{#1}(#2)}} 815 \newcommand{\manpage}[2]{{\emph{#1}(#2)}}
816 \newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}}
806 \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}} 817 \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}}
807 \newcommand{\program}[1]{\strong{#1}} 818 \newcommand{\program}[1]{\strong{#1}}
808 \newcommand{\programopt}[1]{\strong{#1}} 819 \newcommand{\programopt}[1]{\strong{#1}}
809 % Note that \longprogramopt provides the '--'! 820 % Note that \longprogramopt provides the '--'!
810 \newcommand{\longprogramopt}[1]{\strong{-{}-#1}} 821 \newcommand{\longprogramopt}[1]{\strong{-{}-#1}}
908 \item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}} 919 \item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}}
909 (section \ref{module-\py@modulekey}):] 920 (section \ref{module-\py@modulekey}):]
910 #3 921 #3
911 \end{fulllineitems} 922 \end{fulllineitems}
912 } 923 }
924 }
925 % \seepep{number}{title}{why it's interesting}
926 \newcommand{\py@seepep}[3]{%
927 \par%
928 \begin{fulllineitems}
929 \item[\pep{#1}, ``\emph{#2}'']
930 #3
931 \end{fulllineitems}
913 } 932 }
914 % \seerfc{number}{title}{why it's interesting} 933 % \seerfc{number}{title}{why it's interesting}
915 \newcommand{\py@seerfc}[3]{% 934 \newcommand{\py@seerfc}[3]{%
916 \par% 935 \par%
917 \begin{fulllineitems} 936 \begin{fulllineitems}