Gestionnaire de fichiers - Editer - /usr/share/doc/python-kitchen-1.1.1/html/api-collections.html
Arrière
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Kitchen.collections — kitchen 1.1.1 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '', VERSION: '1.1.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within kitchen 1.1.1 documentation" href="_static/opensearch.xml"/> <link rel="top" title="kitchen 1.1.1 documentation" href="index.html" /> <link rel="up" title="Kitchen API" href="api-overview.html" /> <link rel="next" title="Kitchen.iterutils Module" href="api-iterutils.html" /> <link rel="prev" title="UTF-8" href="api-text-utf8.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="api-iterutils.html" title="Kitchen.iterutils Module" accesskey="N">next</a> |</li> <li class="right" > <a href="api-text-utf8.html" title="UTF-8" accesskey="P">previous</a> |</li> <li><a href="index.html">kitchen 1.1.1 documentation</a> »</li> <li><a href="api-overview.html" accesskey="U">Kitchen API</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-kitchen.collections.strictdict"> <span id="kitchen-collections"></span><h1>Kitchen.collections<a class="headerlink" href="#module-kitchen.collections.strictdict" title="Permalink to this headline">¶</a></h1> <div class="section" id="strictdict"> <h2>StrictDict<a class="headerlink" href="#strictdict" title="Permalink to this headline">¶</a></h2> <p><tt class="xref py py-class docutils literal"><span class="pre">kitchen.collections.StrictDict</span></tt> provides a dictionary that treats <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> as distinct key values.</p> <dl class="class"> <dt id="kitchen.collections.strictdict.StrictDict"> <em class="property">class </em><tt class="descclassname">kitchen.collections.strictdict.</tt><tt class="descname">StrictDict</tt><a class="headerlink" href="#kitchen.collections.strictdict.StrictDict" title="Permalink to this definition">¶</a></dt> <dd><p>Map class that considers <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> different keys</p> <p>Ordinarily when you are dealing with a <a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a> keyed on strings you want to have keys that have the same characters end up in the same bucket even if one key is <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> and the other is a byte <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt>. The normal <a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a> type does this for <a class="reference internal" href="glossary.html#term-ascii"><em class="xref std std-term">ASCII</em></a> characters (but not for anything outside of the <a class="reference internal" href="glossary.html#term-ascii"><em class="xref std std-term">ASCII</em></a> range.)</p> <p>Sometimes, however, you want to keep the two string classes strictly separate, for instance, if you’re creating a single table that can map from <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> characters to <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> characters and vice versa. This class will help you do that by making all <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> keys evaluate to a different key than all <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> keys.</p> <div class="admonition-see-also admonition seealso"> <p class="first admonition-title">See also</p> <p class="last"><a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a> for documentation on this class’s methods. This class implements all the standard <a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a> methods. Its treatment of <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> keys as separate is the only difference.</p> </div> </dd></dl> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Kitchen.collections</a><ul> <li><a class="reference internal" href="#strictdict">StrictDict</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="api-text-utf8.html" title="previous chapter">UTF-8</a></p> <h4>Next topic</h4> <p class="topless"><a href="api-iterutils.html" title="next chapter">Kitchen.iterutils Module</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/api-collections.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="api-iterutils.html" title="Kitchen.iterutils Module" >next</a> |</li> <li class="right" > <a href="api-text-utf8.html" title="UTF-8" >previous</a> |</li> <li><a href="index.html">kitchen 1.1.1 documentation</a> »</li> <li><a href="api-overview.html" >Kitchen API</a> »</li> </ul> </div> <div class="footer"> © Copyright 2011 Red Hat, Inc. and others. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0 |
proxy
|
phpinfo
|
Réglages