mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
fixed FIXMEs
This commit is contained in:
@@ -178,7 +178,7 @@ SyntaxError: non-keyword arg after keyword arg</samp></pre>
|
||||
|
||||
</samp></pre>
|
||||
<ol>
|
||||
<li>The first line imports the <code>humansize</code> program as a module — a chunk of code that you can use interactively, or from a larger Python program. (You’ll see examples of multi-module Python programs in [FIXME xref].) Once you import a module, you can reference any of its public functions, classes, or attributes. Modules can do this to access functionality in other modules, and you can do it in the Python interactive shell too. This is an important concept, and you’ll see a lot more of it throughout this book.
|
||||
<li>The first line imports the <code>humansize</code> program as a module — a chunk of code that you can use interactively, or from a larger Python program. Once you import a module, you can reference any of its public functions, classes, or attributes. Modules can do this to access functionality in other modules, and you can do it in the Python interactive shell too. This is an important concept, and you’ll see a lot more of it throughout this book.
|
||||
<li>When you want to use functions defined in imported modules, you need to include the module name. So you can’t just say <code>approximate_size</code>; it must be <code>humansize.approximate_size</code>. If you’ve used classes in Java, this should feel vaguely familiar.
|
||||
<li>Instead of calling the function as you would expect to, you asked for one of the function’s attributes, <code>__doc__</code>.
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user