per page, with , order by , clip by
Results of 1 - 1 of about 1 for monomorphic (0.000 sec.)
numbers --- 数の抽象基底クラス 9414
numbers --- 数の抽象基底クラス ソースコード: Lib/numbers.py numbers モジュール ( PEP 3141 ) は、下位になるほど多くの演算を定義する、数値の 抽象基底クラス の階層を定義しています。 このモジュールで定義する型は、どれもインスタンス化を目的とした ... 生成するヘルパー関数を定義すると便利です。 例えば fractions.Fraction では、次のようにしています。 def _operator_fallbacks ( monomorphic_operator , fallback_operator ): def forward ( a , b ): if isinstance ( b , ( int , Fraction )): return monomorphic_operato ... a ), b ) else : return NotImplemented forward . __name__ = '__' + fallback_operator . __name__ + '__' forward . __doc__ = monomorphic_operator . __doc__ def reverse ( b , a ): if isinstance ( a , Rational ): # int も含みます。 return monomorphic_operator ( ... x ( b )) else : return NotImplemented reverse . __name__ = '__r' + fallback_operator . __name__ + '__' reverse . __doc__ = monomorphic_operator . __doc__ return forward , reverse def _add ( a , b ): """a + b""" return Fraction ( a . numerator * b . denomina ...
https://man.mtool.work/python/3.14/library/numbers.html
PREV 1 NEXT