PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/1.2.3/generated/cf.FieldList.__getitem__.html

https://bitbucket.org/cfpython/cfpython.bitbucket.org
HTML | 191 lines | 147 code | 14 blank | 30 comment | 0 complexity | ba6940f7d7e89cd24204bac288a89a13 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>cf.FieldList.__getitem__ &mdash; Documentation</title>
  7. <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '../',
  12. VERSION: '1.2.3',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="../_static/jquery.js"></script>
  19. <script type="text/javascript" src="../_static/underscore.js"></script>
  20. <script type="text/javascript" src="../_static/doctools.js"></script>
  21. <script type="text/javascript" src="../_static/copybutton.js"></script>
  22. <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  23. <link rel="top" title="Documentation" href="../index.html" />
  24. <link rel="up" title="cf.FieldList" href="../classes/cf.FieldList.html" />
  25. <link rel="next" title="cf.FieldList.__len__" href="cf.FieldList.__len__.html" />
  26. <link rel="prev" title="cf.FieldList.__contains__" href="cf.FieldList.__contains__.html" />
  27. </head>
  28. <body role="document">
  29. <div class="related" role="navigation" aria-label="related navigation">
  30. <h3>Navigation</h3>
  31. <ul>
  32. <li class="right" style="margin-right: 10px">
  33. <a href="../genindex.html" title="General Index"
  34. accesskey="I">index</a></li>
  35. <li class="right" >
  36. <a href="cf.FieldList.__len__.html" title="cf.FieldList.__len__"
  37. accesskey="N">next</a> |</li>
  38. <li class="right" >
  39. <a href="cf.FieldList.__contains__.html" title="cf.FieldList.__contains__"
  40. accesskey="P">previous</a> |</li>
  41. <li><a target="_blank" href="../../archive.html">Archive</a> &laquo;</li>
  42. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python 1.2.3</a> &raquo;</li>
  43. <!--
  44. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python</a> &raquo;</li>
  45. <li><select onchange="location = this.options[this.selectedIndex].value;">
  46. <option value="../../1.0/index.html">1.0
  47. <option value="../../0.9.9/index.html">0.9.9
  48. <option value="../../0.9.8.3/index.html">0.9.8.3
  49. <option value="../../archive.html">Archive
  50. </select>
  51. </li>
  52. -->
  53. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &raquo;</li>
  54. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &raquo;</li>
  55. <li class="nav-item nav-item-2"><a href="../class.html" >Classes of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &raquo;</li>
  56. <li class="nav-item nav-item-3"><a href="../classes/cf.FieldList.html" accesskey="U">cf.FieldList</a> &raquo;</li>
  57. </ul>
  58. </div>
  59. <div class="document">
  60. <div class="documentwrapper">
  61. <div class="bodywrapper">
  62. <div class="body" role="main">
  63. <div class="section" id="cf-fieldlist-getitem">
  64. <h1>cf.FieldList.__getitem__<a class="headerlink" href="#cf-fieldlist-getitem" title="Permalink to this headline">Âś</a></h1>
  65. <dl class="method">
  66. <dt id="cf.FieldList.__getitem__">
  67. <code class="descclassname">FieldList.</code><code class="descname">__getitem__</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="reference external" href="https://bitbucket.org/cfpython/cf-python/src/v1.2.3/cf/field.py#field.py-12476"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cf.FieldList.__getitem__" title="Permalink to this definition">Âś</a></dt>
  68. <dd><p>Called to implement evaluation of f[index]</p>
  69. <p>f.__getitem_(index) &lt;==&gt; f[index]</p>
  70. <table class="docutils field-list" frame="void" rules="none">
  71. <col class="field-name" />
  72. <col class="field-body" />
  73. <tbody valign="top">
  74. <tr class="field-odd field"><th class="field-name">Examples 1:</th><td class="field-body"></td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. <div class="highlight-python"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
  79. <span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
  80. <span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">]</span>
  81. </pre></div>
  82. </div>
  83. <table class="docutils field-list" frame="void" rules="none">
  84. <col class="field-name" />
  85. <col class="field-body" />
  86. <tbody valign="top">
  87. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
  88. <dt>out: <a class="reference internal" href="../classes/cf.Field.html#cf.Field" title="cf.Field"><code class="xref py py-obj docutils literal"><span class="pre">cf.Field</span></code></a> or <a class="reference internal" href="../classes/cf.FieldList.html#cf.FieldList" title="cf.FieldList"><code class="xref py py-obj docutils literal"><span class="pre">cf.FieldList</span></code></a></dt>
  89. <dd><p class="first last">If <em>index</em> is an integer then a field is returned. If <em>index</em>
  90. is a slice then a field list is returned, which may be empty.</p>
  91. </dd>
  92. </dl>
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </dd></dl>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  103. <div class="sphinxsidebarwrapper">
  104. <h4>Previous topic</h4>
  105. <p class="topless"><a href="cf.FieldList.__contains__.html"
  106. title="previous chapter">cf.FieldList.__contains__</a></p>
  107. <h4>Next topic</h4>
  108. <p class="topless"><a href="cf.FieldList.__len__.html"
  109. title="next chapter">cf.FieldList.__len__</a></p>
  110. <div role="note" aria-label="source link">
  111. <h3>This Page</h3>
  112. <ul class="this-page-menu">
  113. <li><a href="../_sources/generated/cf.FieldList.__getitem__.txt"
  114. rel="nofollow">Show Source</a></li>
  115. </ul>
  116. </div>
  117. <div id="searchbox" style="display: none" role="search">
  118. <h3>Quick search</h3>
  119. <form class="search" action="../search.html" method="get">
  120. <input type="text" name="q" />
  121. <input type="submit" value="Go" />
  122. <input type="hidden" name="check_keywords" value="yes" />
  123. <input type="hidden" name="area" value="default" />
  124. </form>
  125. </div>
  126. <script type="text/javascript">$('#searchbox').show(0);</script>
  127. </div>
  128. </div>
  129. <div class="clearer"></div>
  130. </div>
  131. <div class="related" role="navigation" aria-label="related navigation">
  132. <h3>Navigation</h3>
  133. <ul>
  134. <li class="right" style="margin-right: 10px">
  135. <a href="../genindex.html" title="General Index"
  136. >index</a></li>
  137. <li class="right" >
  138. <a href="cf.FieldList.__len__.html" title="cf.FieldList.__len__"
  139. >next</a> |</li>
  140. <li class="right" >
  141. <a href="cf.FieldList.__contains__.html" title="cf.FieldList.__contains__"
  142. >previous</a> |</li>
  143. <li><a target="_blank" href="../../archive.html">Archive</a> &laquo;</li>
  144. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python 1.2.3</a> &raquo;</li>
  145. <!--
  146. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python</a> &raquo;</li>
  147. <li><select onchange="location = this.options[this.selectedIndex].value;">
  148. <option value="../../1.0/index.html">1.0
  149. <option value="../../0.9.9/index.html">0.9.9
  150. <option value="../../0.9.8.3/index.html">0.9.8.3
  151. <option value="../../archive.html">Archive
  152. </select>
  153. </li>
  154. -->
  155. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &raquo;</li>
  156. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &raquo;</li>
  157. <li class="nav-item nav-item-2"><a href="../class.html" >Classes of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &raquo;</li>
  158. <li class="nav-item nav-item-3"><a href="../classes/cf.FieldList.html" >cf.FieldList</a> &raquo;</li>
  159. </ul>
  160. </div>
  161. <div class="footer" role="contentinfo">
  162. &copy; Copyright 2016, David Hassell.
  163. Last updated on Aug 23, 2016.
  164. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.1.
  165. </div>
  166. </body>
  167. </html>