mirror of
https://github.com/python/cpython.git
synced 2025-07-25 20:24:11 +00:00
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.
This commit is contained in:
parent
986badae1e
commit
06a01e84b9
2 changed files with 23 additions and 0 deletions
|
@ -906,6 +906,17 @@ sub do_env_classdesc{
|
|||
return handle_classlike_descriptor(@_[0], "class");
|
||||
}
|
||||
|
||||
sub do_env_classdescstar{
|
||||
local($_) = @_;
|
||||
$THIS_CLASS = next_argument();
|
||||
$idx = make_str_index_entry(
|
||||
"<tt class='class'>$THIS_CLASS</tt> (class in $THIS_MODULE)" );
|
||||
$idx =~ s/ \(.*\)//;
|
||||
return ("<dl><dt><b>class $idx</b>\n<dd>"
|
||||
. $_
|
||||
. '</dl>');
|
||||
}
|
||||
|
||||
sub do_env_excclassdesc{
|
||||
return handle_classlike_descriptor(@_[0], "exception");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue