mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
validation typo
This commit is contained in:
@@ -355,7 +355,7 @@ class FieldStorage:
|
||||
|
||||
<h2 id=acts-like-number>Classes That Act Like Numbers</h2>
|
||||
|
||||
<p>Using the appropriate special methods, you can define your own classes that act like numbers. That is, you can add them, subtract them, and perform other mathematical operations on them. This is how <dfn>fractions</dfn> are implemented</a> — the <code><dfn>Fraction</dfn></code> class implements these special methods, then you can do things like this:
|
||||
<p>Using the appropriate special methods, you can define your own classes that act like numbers. That is, you can add them, subtract them, and perform other mathematical operations on them. This is how <dfn>fractions</dfn> are implemented — the <code><dfn>Fraction</dfn></code> class implements these special methods, then you can do things like this:
|
||||
|
||||
<pre class=screen>
|
||||
<samp class=p>>>> </samp><kbd class=pp>from fractions import Fraction</kbd>
|
||||
|
||||
Reference in New Issue
Block a user