mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
144 lines
11 KiB
HTML
144 lines
11 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module structures</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>structures</strong></big></big></font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/gl/pylink/structures.py">/home/gl/pylink/structures.py</a></font></td></tr></table>
|
|
<p><tt>structures.py - PyLink data structures module.<br>
|
|
<br>
|
|
This module contains custom data structures that may be useful in various situations.</tt></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="collections.html">collections</a><br>
|
|
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="collections.html#defaultdict">collections.defaultdict</a>(<a href="builtins.html#dict">builtins.dict</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="structures.html#KeyedDefaultdict">KeyedDefaultdict</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="KeyedDefaultdict">class <strong>KeyedDefaultdict</strong></a>(<a href="collections.html#defaultdict">collections.defaultdict</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Subclass of <a href="collections.html#defaultdict">defaultdict</a> allowing the key to be passed to the default factory.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="structures.html#KeyedDefaultdict">KeyedDefaultdict</a></dd>
|
|
<dd><a href="collections.html#defaultdict">collections.defaultdict</a></dd>
|
|
<dd><a href="builtins.html#dict">builtins.dict</a></dd>
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="KeyedDefaultdict-__missing__"><strong>__missing__</strong></a>(self, key)</dt></dl>
|
|
|
|
<hr>
|
|
Data descriptors defined here:<br>
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods inherited from <a href="collections.html#defaultdict">collections.defaultdict</a>:<br>
|
|
<dl><dt><a name="KeyedDefaultdict-__copy__"><strong>__copy__</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-copy">copy</a>() -> a shallow copy of D.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>Return state information for pickling.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-copy"><strong>copy</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-copy">copy</a>() -> a shallow copy of D.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data descriptors inherited from <a href="collections.html#defaultdict">collections.defaultdict</a>:<br>
|
|
<dl><dt><strong>default_factory</strong></dt>
|
|
<dd><tt>Factory for default value called by __missing__().</tt></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods inherited from <a href="builtins.html#dict">builtins.dict</a>:<br>
|
|
<dl><dt><a name="KeyedDefaultdict-__contains__"><strong>__contains__</strong></a>(self, key, /)</dt><dd><tt>True if D has a key k, else False.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__delitem__"><strong>__delitem__</strong></a>(self, key, /)</dt><dd><tt>Delete self[key].</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__eq__"><strong>__eq__</strong></a>(self, value, /)</dt><dd><tt>Return self==value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__ge__"><strong>__ge__</strong></a>(self, value, /)</dt><dd><tt>Return self>=value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedDefaultdict-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__gt__"><strong>__gt__</strong></a>(self, value, /)</dt><dd><tt>Return self>value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__iter__"><strong>__iter__</strong></a>(self, /)</dt><dd><tt>Implement iter(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__le__"><strong>__le__</strong></a>(self, value, /)</dt><dd><tt>Return self<=value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__len__"><strong>__len__</strong></a>(self, /)</dt><dd><tt>Return len(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__lt__"><strong>__lt__</strong></a>(self, value, /)</dt><dd><tt>Return self<value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__ne__"><strong>__ne__</strong></a>(self, value, /)</dt><dd><tt>Return self!=value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__setitem__"><strong>__setitem__</strong></a>(self, key, value, /)</dt><dd><tt>Set self[key] to value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-__sizeof__">__sizeof__</a>() -> size of D in memory, in bytes</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-clear"><strong>clear</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-clear">clear</a>() -> None. Remove all items from D.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-fromkeys"><strong>fromkeys</strong></a>(iterable, value=None, /)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Returns a new dict with keys from iterable and values equal to value.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-get"><strong>get</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-get">get</a>(k[,d]) -> D[k] if k in D, else d. d defaults to None.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-items"><strong>items</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-items">items</a>() -> a set-like object providing a view on D's items</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-keys"><strong>keys</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-keys">keys</a>() -> a set-like object providing a view on D's keys</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-pop"><strong>pop</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-pop">pop</a>(k[,d]) -> v, remove specified key and return the corresponding value.<br>
|
|
If key is not found, d is returned if given, otherwise KeyError is raised</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-popitem"><strong>popitem</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-popitem">popitem</a>() -> (k, v), remove and return some (key, value) pair as a<br>
|
|
2-tuple; but raise KeyError if D is empty.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-setdefault"><strong>setdefault</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-setdefault">setdefault</a>(k[,d]) -> D.<a href="#KeyedDefaultdict-get">get</a>(k,d), also set D[k]=d if k not in D</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-update"><strong>update</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-update">update</a>([E, ]**F) -> None. Update D from dict/iterable E and F.<br>
|
|
If E is present and has a .<a href="#KeyedDefaultdict-keys">keys</a>() method, then does: for k in E: D[k] = E[k]<br>
|
|
If E is present and lacks a .<a href="#KeyedDefaultdict-keys">keys</a>() method, then does: for k, v in E: D[k] = v<br>
|
|
In either case, this is followed by: for k in F: D[k] = F[k]</tt></dd></dl>
|
|
|
|
<dl><dt><a name="KeyedDefaultdict-values"><strong>values</strong></a>(...)</dt><dd><tt>D.<a href="#KeyedDefaultdict-values">values</a>() -> an object providing a view on D's values</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data and other attributes inherited from <a href="builtins.html#dict">builtins.dict</a>:<br>
|
|
<dl><dt><strong>__hash__</strong> = None</dl>
|
|
|
|
</td></tr></table></td></tr></table>
|
|
</body></html> |