-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove base
_CachingProtocolMeta
and use beartype
's instead
Now that beartype/beartype#86 has landed (and made it into a release), we can remove our own base implementation and use that one instead. We still provide our own implementation that allows overriding runtime checking, but it neatly derives from ``beartype``'s.
- Loading branch information
Showing
27 changed files
with
149 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), Rational) | ||
356 ns ± 15.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
244 ns ± 8.05 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), Rational) | ||
350 ns ± 14.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
237 ns ± 4.85 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(builtins.float(3.0), Rational) | ||
359 ns ± 3.21 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
273 ns ± 9.28 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), SupportsLotsOfNumberStuff) | ||
136 µs ± 3.3 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
207 ns ± 9.04 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), SupportsLotsOfNumberStuff) | ||
154 µs ± 5.94 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
203 ns ± 1.85 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(builtins.float(3.0), SupportsLotsOfNumberStuff) | ||
149 µs ± 8.33 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) | ||
220 ns ± 42 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%timeit isinstance(builtins.int(1), SupportsNumeratorDenominator) | ||
13 µs ± 270 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
12.5 µs ± 1.45 µs per loop (mean ± std. dev. of 7 runs, 100,000 loops each) | ||
%timeit isinstance(fractions.Fraction(2), SupportsNumeratorDenominator) | ||
14 µs ± 761 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
11.1 µs ± 864 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each) | ||
%timeit isinstance(builtins.float(3.0), SupportsNumeratorDenominator) | ||
15.4 µs ± 323 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
12.2 µs ± 1.96 µs per loop (mean ± std. dev. of 7 runs, 100,000 loops each) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
%timeit isinstance(builtins.int(1), _SupportsComplexOps) | ||
11.9 µs ± 279 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
340 ns ± 121 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(builtins.int(1), SupportsComplexOps) | ||
312 ns ± 1.56 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
258 ns ± 25.9 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
|
||
%timeit isinstance(builtins.float(2.0), _SupportsComplexOps) | ||
13.1 µs ± 385 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
224 ns ± 5.17 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(builtins.float(2.0), SupportsComplexOps) | ||
380 ns ± 23 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
221 ns ± 10.6 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
|
||
%timeit isinstance(decimal.Decimal(3), _SupportsComplexOps) | ||
13.3 µs ± 897 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
242 ns ± 18.2 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(decimal.Decimal(3), SupportsComplexOps) | ||
322 ns ± 12.4 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
245 ns ± 27.5 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
|
||
%timeit isinstance(fractions.Fraction(4), _SupportsComplexOps) | ||
11.9 µs ± 178 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
245 ns ± 27.6 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(fractions.Fraction(4), SupportsComplexOps) | ||
314 ns ± 1.54 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
234 ns ± 17.2 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
|
||
%timeit isinstance(sympy.core.numbers.Integer(5), _SupportsComplexOps) | ||
12 µs ± 110 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) | ||
227 ns ± 10.6 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
%timeit isinstance(sympy.core.numbers.Integer(5), SupportsComplexOps) | ||
315 ns ± 4.39 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | ||
225 ns ± 13.3 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.