Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157825)

## Delta Between Two Patch Sets: Lib/numbers.py

Issue 11610: Improving property to accept abstract methods
Left Patch Set: Created 8 years ago
Right Patch Set: Created 8 years ago
 Left: Base Patch Set 1: None Patch Set 2: None Patch Set 3: None Patch Set 4: None Patch Set 5: None Patch Set 6: None Patch Set 7: None Patch Set 8: None Patch Set 9: None Patch Set 10: None Patch Set 11: None Right: Patch Set 1: None Patch Set 2: None Patch Set 3: None Patch Set 4: None Patch Set 5: None Patch Set 6: None Patch Set 7: None Patch Set 8: None Patch Set 9: None Patch Set 10: None Patch Set 11: None
« no previous file with change/comment | « Lib/abc.py ('k') | Lib/test/test_abc.py » ('j') | no next file with change/comment »
LEFTRIGHT
2 # Licensed to PSF under a Contributor Agreement. 2 # Licensed to PSF under a Contributor Agreement.
3 3
4 """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. 4 """Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
5 5
6 TODO: Fill out more detailed documentation on the operators.""" 6 TODO: Fill out more detailed documentation on the operators."""
7 7
8 from abc import ABCMeta, abstractmethod 8 from abc import ABCMeta, abstractmethod
9 9
10 __all__ = ["Number", "Complex", "Real", "Rational", "Integral"] 10 __all__ = ["Number", "Complex", "Real", "Rational", "Integral"]
(...skipping 374 matching lines...)
385 def numerator(self): 385 def numerator(self):
386 """Integers are their own numerators.""" 386 """Integers are their own numerators."""
387 return +self 387 return +self
388 388
389 @property 389 @property
390 def denominator(self): 390 def denominator(self):
391 """Integers have a denominator of 1.""" 391 """Integers have a denominator of 1."""
392 return 1 392 return 1
393 393
394 Integral.register(int) 394 Integral.register(int)
LEFTRIGHT

This is Rietveld 894c83f36cb7+