Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e60796

Browse files
committed
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.
1 parent 75c6cb9 commit 4e60796

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Doc/texinputs/python.sty

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,16 @@
601601
\withsubitem{(class in \py@thismodule)}{\ttindex{#1}}]
602602
}{\end{fulllineitems}}
603603

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+
604614

605615
\let\py@classbadkey=\@undefined
606616

@@ -803,6 +813,7 @@
803813
\newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic
804814

805815
\newcommand{\manpage}[2]{{\emph{#1}(#2)}}
816+
\newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}}
806817
\newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}}
807818
\newcommand{\program}[1]{\strong{#1}}
808819
\newcommand{\programopt}[1]{\strong{#1}}
@@ -911,6 +922,14 @@
911922
\end{fulllineitems}
912923
}
913924
}
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}
932+
}
914933
% \seerfc{number}{title}{why it's interesting}
915934
\newcommand{\py@seerfc}[3]{%
916935
\par%

0 commit comments

Comments
 (0)