Skip to content

Commit 566f27e

Browse files
committed
Imports, Iterable duck types
1 parent b45b945 commit 566f27e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ import <module> # Imports a built-in or '<module>.py'.
823823
import <package> # Imports a built-in or '<package>/__init__.py'.
824824
import <package>.<module> # Imports a built-in or '<package>/<module>.py'.
825825
```
826-
* **Package is a collection of modules, but it can also define its own objects, classes, etc.**
826+
* **Package is a collection of modules, but it can also define its own functions, classes, etc.**
827827
* **On a filesystem this corresponds to a directory of Python files with an optional init script.**
828828
* **Running `'import <package>'` does not automatically provide access to the package's modules unless they are explicitly imported in the `'<package>/__init__.py'` script.**
829829
* **Directory of the file that is passed to python command serves as a root of local imports.**
@@ -1262,7 +1262,7 @@ class MyCollection:
12621262
```
12631263

12641264
### Sequence
1265-
* **Only required methods are getitem() and len(). Getitem() should return the item at the passed index or raise IndexError (this excludes dictionaries because they accept keys).**
1265+
* **Only required methods are getitem() and len(). Getitem() should return the item at the passed index or raise IndexError (it may also support negative indices and/or slices).**
12661266
* **Iter() and contains() automatically work on any object that has getitem() defined.**
12671267
* **Reversed() automatically works on any object that has getitem() and len() defined. It returns reversed iterator of object's items.**
12681268
```python

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704

705705

706706
<ul>
707-
<li><strong>Package is a collection of modules, but it can also define its own objects, classes, etc.</strong></li>
707+
<li><strong>Package is a collection of modules, but it can also define its own functions, classes, etc.</strong></li>
708708
<li><strong>On a filesystem this corresponds to a directory of Python files with an optional init script.</strong></li>
709709
<li><strong>Running <code class="python hljs"><span class="hljs-string">'import &lt;package&gt;'</span></code> does not automatically provide access to the package's modules unless they are explicitly imported in the <code class="python hljs"><span class="hljs-string">'&lt;package&gt;/__init__.py'</span></code> script.</strong></li>
710710
<li><strong>Directory of the file that is passed to python command serves as a root of local imports.</strong></li>
@@ -1085,7 +1085,7 @@
10851085

10861086

10871087
<div><h3 id="sequence">Sequence</h3><ul>
1088-
<li><strong>Only required methods are getitem() and len(). Getitem() should return the item at the passed index or raise IndexError (this excludes dictionaries because they accept keys).</strong></li>
1088+
<li><strong>Only required methods are getitem() and len(). Getitem() should return the item at the passed index or raise IndexError (it may also support negative indices and/or slices).</strong></li>
10891089
<li><strong>Iter() and contains() automatically work on any object that has getitem() defined.</strong></li>
10901090
<li><strong>Reversed() automatically works on any object that has getitem() and len() defined. It returns reversed iterator of object's items.</strong></li>
10911091
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MySequence</span>:</span>

0 commit comments

Comments
 (0)