Issue #23641: Cleaned out legacy dunder names from tests and docs.

Fixed 2 to 3 porting bug in pynche.ColorDB.
Added few tests for __truediv__, __floordiv__ and __matmul__.
This commit is contained in:
Serhiy Storchaka 2015-03-12 22:01:30 +02:00
commit c2ccce791c
19 changed files with 86 additions and 124 deletions

View file

@ -1831,9 +1831,9 @@ __gt__
__hash__
__iadd__
__iand__
__idivmod__
__ifloordiv__
__ilshift__
__imatmul__
__imod__
__imul__
__index__
@ -1850,6 +1850,7 @@ __le__
__len__
__lshift__
__lt__
__matmul__
__mod__
__mul__
__neg__
@ -1864,6 +1865,7 @@ __rdivmod__
__repr__
__rfloordiv__
__rlshift__
__rmatmul__
__rmod__
__rmul__
__ror__

View file

@ -23,7 +23,6 @@ color formats, and for calculating other color values.
import sys
import re
from types import *
import operator
class BadColor(Exception):
pass
@ -230,9 +229,8 @@ def triplet_to_rrggbb(rgbtuple):
return hexname
_maxtuple = (256.0,) * 3
def triplet_to_fractional_rgb(rgbtuple):
return list(map(operator.__div__, rgbtuple, _maxtuple))
return [x / 256 for x in rgbtuple]
def triplet_to_brightness(rgbtuple):