Skip to content

Commit

Permalink
Structured the protocols analogous to the python datamodel docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Feb 23, 2024
1 parent b522a24 commit 46ac0ea
Show file tree
Hide file tree
Showing 12 changed files with 604 additions and 774 deletions.
129 changes: 66 additions & 63 deletions optype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
'CanCeil',
'CanComplex',
'CanContains',
'CanDel',
'CanDelattr',
'CanDelitem',
'CanDir',
'CanDivmod',
Expand All @@ -18,6 +20,8 @@
'CanFloordiv',
'CanFormat',
'CanGe',
'CanGetattr',
'CanGetattribute',
'CanGetitem',
'CanGt',
'CanHash',
Expand Down Expand Up @@ -53,7 +57,8 @@
'CanOr',
'CanPos',
'CanPow',
'CanPow0',
'CanPow2',
'CanPow3',
'CanRAdd',
'CanRAnd',
'CanRDivmod',
Expand All @@ -71,8 +76,10 @@
'CanRepr',
'CanReversed',
'CanRound',
'CanRound0',
'CanRound1',
'CanRound2',
'CanRshift',
'CanSetattr',
'CanSetitem',
'CanStr',
'CanSub',
Expand All @@ -94,25 +101,33 @@

from importlib import metadata as _metadata

from ._binops import (
from ._can import (
CanAbs,
CanAdd,
CanAiter,
CanAnd,
CanAnext,
CanBool,
CanBytes,
CanCeil,
CanComplex,
CanContains,
CanDel,
CanDelattr,
CanDelitem,
CanDir,
CanDivmod,
CanEq,
CanFloat,
CanFloor,
CanFloordiv,
CanLshift,
CanMatmul,
CanMod,
CanMul,
CanOr,
CanPow,
CanPow0,
CanRshift,
CanSub,
CanTruediv,
CanXor,
)
from ._binops_i import (
CanFormat,
CanGe,
CanGetattr,
CanGetattribute,
CanGetitem,
CanGt,
CanHash,
CanIAdd,
CanIAnd,
CanIFloordiv,
Expand All @@ -126,8 +141,27 @@
CanISub,
CanITruediv,
CanIXor,
)
from ._binops_r import (
CanIndex,
CanInt,
CanInvert,
CanIter,
CanLe,
CanLen,
CanLengthHint,
CanLshift,
CanLt,
CanMatmul,
CanMissing,
CanMod,
CanMul,
CanNe,
CanNeg,
CanNext,
CanOr,
CanPos,
CanPow,
CanPow2,
CanPow3,
CanRAdd,
CanRAnd,
CanRDivmod,
Expand All @@ -142,37 +176,21 @@
CanRSub,
CanRTruediv,
CanRXor,
)
from ._cmpops import (
CanEq,
CanGe,
CanGt,
CanLe,
CanLt,
CanNe,
)
from ._containers import (
CanContains,
CanDelitem,
CanGetitem,
CanMissing,
CanSetitem,
)
from ._nullops import (
CanBool,
CanBytes,
CanComplex,
CanFloat,
CanHash,
CanIndex,
CanInt,
CanLen,
CanLengthHint,
CanRepr,
CanReversed,
CanRound,
CanRound1,
CanRound2,
CanRshift,
CanSetattr,
CanSetitem,
CanStr,
CanSub,
CanTruediv,
CanTrunc,
CanXor,
)
from ._slice import Slice
from ._specialattrs import (
from ._has import (
HasAnnotations,
HasDict,
HasDoc,
Expand All @@ -183,22 +201,7 @@
HasWeakProxy,
HasWeakReference,
)
from ._unops import (
CanAbs,
CanAiter,
CanAnext,
CanCeil,
CanDir,
CanFloor,
CanInvert,
CanIter,
CanNeg,
CanNext,
CanPos,
CanReversed,
CanRound,
CanRound0,
CanTrunc,
)
from ._slice import Slice


__version__: str = _metadata.version(__package__ or __file__.split('/')[-1])
127 changes: 0 additions & 127 deletions optype/_binops.py

This file was deleted.

Loading

0 comments on commit 46ac0ea

Please sign in to comment.