<legend id='M5N0X'><style id='M5N0X'><dir id='M5N0X'><q id='M5N0X'></q></dir></style></legend>
    1. <small id='M5N0X'></small><noframes id='M5N0X'>

        <bdo id='M5N0X'></bdo><ul id='M5N0X'></ul>
      <tfoot id='M5N0X'></tfoot>

      1. <i id='M5N0X'><tr id='M5N0X'><dt id='M5N0X'><q id='M5N0X'><span id='M5N0X'><b id='M5N0X'><form id='M5N0X'><ins id='M5N0X'></ins><ul id='M5N0X'></ul><sub id='M5N0X'></sub></form><legend id='M5N0X'></legend><bdo id='M5N0X'><pre id='M5N0X'><center id='M5N0X'></center></pre></bdo></b><th id='M5N0X'></th></span></q></dt></tr></i><div id='M5N0X'><tfoot id='M5N0X'></tfoot><dl id='M5N0X'><fieldset id='M5N0X'></fieldset></dl></div>

        扭曲的文档字符串中这些格式的含义是什么?

        时间:2023-10-09
        <legend id='OR4Rv'><style id='OR4Rv'><dir id='OR4Rv'><q id='OR4Rv'></q></dir></style></legend>
        • <bdo id='OR4Rv'></bdo><ul id='OR4Rv'></ul>

        • <tfoot id='OR4Rv'></tfoot>
          <i id='OR4Rv'><tr id='OR4Rv'><dt id='OR4Rv'><q id='OR4Rv'><span id='OR4Rv'><b id='OR4Rv'><form id='OR4Rv'><ins id='OR4Rv'></ins><ul id='OR4Rv'></ul><sub id='OR4Rv'></sub></form><legend id='OR4Rv'></legend><bdo id='OR4Rv'><pre id='OR4Rv'><center id='OR4Rv'></center></pre></bdo></b><th id='OR4Rv'></th></span></q></dt></tr></i><div id='OR4Rv'><tfoot id='OR4Rv'></tfoot><dl id='OR4Rv'><fieldset id='OR4Rv'></fieldset></dl></div>
                  <tbody id='OR4Rv'></tbody>

                  <small id='OR4Rv'></small><noframes id='OR4Rv'>

                  本文介绍了扭曲的文档字符串中这些格式的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  在twisted的源代码中,很多文档字符串包含这样的格式:L{xxx}或C{xxx}或以'@'开头的行,它们的含义是什么?

                  In twisted's sourcecode, many docstrings contain formats like this: L{xxx} or C{xxx} or a line begin with an '@', what's their meanings?

                  例如,在twisted/internet/interfaces.py中:

                  for example, in twisted/internet/interfaces.py:

                  def registerProducer(producer, streaming):
                      """
                      Register to receive data from a producer.
                      ...
                      For L{IPullProducer} providers, C{resumeProducing} will be called once
                      each time data is required.
                      ...
                      @type producer: L{IProducer} provider
                      ...
                      @return: C{None}
                      """
                  

                  L{IPullProducer} , C{resumeProducing} , @type producer ?

                  顺便问一下,这些格式是标准 python 文档字符串格式的一部分吗?如果是这样,我应该参考哪里?谢谢:)

                  By the way, are these formats a part of standard python docstring formats? If so, where should I refer to? Thanks :)

                  推荐答案

                  Twisted 使用的文档格式是 Epytext,记录在 epydoc.sourceforge.net 上.

                  The documentation format used by Twisted is Epytext, which is documented on epydoc.sourceforge.net.

                  L{} 表示链接"(即这是一个 Python 标识符,请链接到它") C{} 表示代码"(即 hello C{foo} bar 的格式应类似于hello foo bar").I{} 仅表示斜体".您可以在 epytext 文档中看到更多字段.

                  L{} means "link" (i.e. "this is a Python identifier, please link to it") C{} means "code" (i.e. hello C{foo} bar should be formatted like "hello foo bar"). I{} just means "in italics". You can see more fields in the epytext documentation.

                  Twisted 项目使用 pydoctor 生成其文档,使用像 pydoctor --add-package 这样的调用扭曲.它还有更多内容,可以生成指向 Twisted 所依赖的其他几个项目的链接,但如果你想向 Twisted 贡献文档字符串,你可以使用它来获得一个想法.您也可以使用 epydoc 本身生成文档,使用 epydoc twisted,但 epydoc 不了解 Zope 接口,因此不会自动将类链接到它们实现的接口.

                  The Twisted project generates its documentation with pydoctor, using an invocation like pydoctor --add-package twisted. There's a little more to it, to generate links to a couple of other projects that Twisted relies upon, but you can use that to get an idea if you want to contribute docstrings to Twisted. You can also generate the documentation with epydoc itself, using epydoc twisted, but epydoc doesn't know about Zope Interface and so won't automatically link classes to the interfaces that they implement.

                  为每个版本生成的 API 文档发布在 twistedmatrix.com,您可以在那里浏览它.

                  The generated API documentation for each release is published on twistedmatrix.com, and you can browse it there.

                  这篇关于扭曲的文档字符串中这些格式的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何打印带有数千个分隔符的浮点数? 下一篇:在 Python 中解析 CS:GO 脚本文件

                  相关文章

                  最新文章

                • <legend id='YhfEQ'><style id='YhfEQ'><dir id='YhfEQ'><q id='YhfEQ'></q></dir></style></legend>
                • <small id='YhfEQ'></small><noframes id='YhfEQ'>

                    <tfoot id='YhfEQ'></tfoot>

                  1. <i id='YhfEQ'><tr id='YhfEQ'><dt id='YhfEQ'><q id='YhfEQ'><span id='YhfEQ'><b id='YhfEQ'><form id='YhfEQ'><ins id='YhfEQ'></ins><ul id='YhfEQ'></ul><sub id='YhfEQ'></sub></form><legend id='YhfEQ'></legend><bdo id='YhfEQ'><pre id='YhfEQ'><center id='YhfEQ'></center></pre></bdo></b><th id='YhfEQ'></th></span></q></dt></tr></i><div id='YhfEQ'><tfoot id='YhfEQ'></tfoot><dl id='YhfEQ'><fieldset id='YhfEQ'></fieldset></dl></div>

                      • <bdo id='YhfEQ'></bdo><ul id='YhfEQ'></ul>