mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
83 lines
1.9 KiB
Python
83 lines
1.9 KiB
Python
"""Skeleton for 'decimal' stdlib module."""
|
|
|
|
|
|
import decimal
|
|
|
|
|
|
def getcontext():
|
|
"""Returns this thread's context.
|
|
|
|
:rtype: decimal.Context
|
|
"""
|
|
return decimal.Context()
|
|
|
|
|
|
def setcontext(context):
|
|
"""Set this thread's context to context.
|
|
|
|
:type context: decimal.Context
|
|
:rtype: None
|
|
"""
|
|
pass
|
|
|
|
|
|
class Decimal(object):
|
|
"""Floating point class for decimal arithmetic."""
|
|
|
|
def __add__(self, other, context=None):
|
|
"""Returns self + other.
|
|
|
|
:type other: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|
|
|
|
def __sub__(self, other, context=None):
|
|
"""Return self - other.
|
|
|
|
:type other: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|
|
|
|
def __mul__(self, other, context=None):
|
|
"""Return self * other.
|
|
|
|
:type other: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|
|
|
|
|
|
def __truediv__(self, other, context=None):
|
|
"""Return self / other.
|
|
|
|
:type other: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|
|
|
|
|
|
def __floordiv__(self, other, context=None):
|
|
"""Return self // other.
|
|
|
|
:type other: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|
|
|
|
def __pow__(self, other, modulo=None, context=None):
|
|
"""Return self ** other [ % modulo].
|
|
|
|
:type other: numbers.Number
|
|
:type modulo: numbers.Number
|
|
:type context: decimal.Context | None
|
|
:rtype: decimal.Decimal
|
|
"""
|
|
return decimal.Decimal()
|