-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support floattype(Rational)
and require <:AbstractFloat for fallback
#177
Conversation
afe3f9b
to
186aa63
Compare
floattype(Rational)
and guarantee AbstractFloat returnfloattype(Rational)
and require <:AbstractFloat for fallback
OK, this has been pretty extensively reworked. First, this issues a deprecation warning rather than an error. Second, it clarifies when it's OK to extend this to support non-AbstractFloats. I'm contemplating releasing this as part of the 0.8 series, rather than as the beginning of a 0.9 series. I've traditionally viewed depwarns as more breaking than others have, but I'm beginning to be more cautious about tagging-churn in the dependencies. Thoughts? |
Codecov Report
@@ Coverage Diff @@
## master #177 +/- ##
==========================================
- Coverage 87.84% 87.61% -0.24%
==========================================
Files 5 6 +1
Lines 436 444 +8
==========================================
+ Hits 383 389 +6
- Misses 53 55 +2
Continue to review full report at Codecov.
|
A demo in the OP of JuliaGraphics/ColorTypes.jl#177 needed to add support for |
It seems that what
|
|
FixedPointNumbers is still in v0 series, so I think it is OK. However, v0.8 is starting to be used as the blocking by ColorTypes and Colors has been lifted. Therefore, it is better to make decisions early. |
I thought about adding it for |
It seems to be a non-sequitur to allow `floattype` to return a type that is not an `AbstractFloat`, unless it has been extended as such. The docs have been enhanced to clarify when it is OK to extend `floattype` in ways that don't return an `AbstractFloat`. Breaking change: no, not counting the deprecation warning.
e1c9cbf
to
54fda32
Compare
It's long overdue, but I'm finally ready to submit the implementation of JuliaGraphics/ColorVectorSpace.jl#126. I aim to merge dependencies in FixedPointNumbers and ColorTypes first, so expect a couple of PRs (like this one) that have languished to move into the "let's merge this" mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are trivial comments.
I think that changing Irrational
to AbstractIrrational
will cover all the subtypes of Real
defined in Base
.
The more "dangerous"
(breaking)part of this is that it seems to be a non-sequitur to allowfloattype
to fall back to returning a type that is not anAbstractFloat
.Consequently this will now return aMethodError
under more circumstances.