Opened 8 years ago
Last modified 7 years ago
#14422 new defect
Rename `sage.symbolic.units.is_unit`
Reported by: | eviatarbach | Owned by: | burcin |
---|---|---|---|
Priority: | minor | Milestone: | sage-6.4 |
Component: | symbolics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
sage.symbolic.units.is_unit
should be renamed, since there are is_unit
methods for Expression
and Integer
, for example, with completely different functionality. This is confusing, especially since you can do the following:
sage: units.length.meter.is_unit() True sage: x.is_unit() True sage: sage.symbolic.units.is_unit(units.length.meter) True sage: sage.symbolic.units.is_unit(x) False
Perhaps something like is_measurement_unit
would be better?
Change History (5)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:3 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:4 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:5 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
Note: See
TracTickets for help on using
tickets.
I believe (I haven't checked this) that those
is_unit()
methods are on instances ofExpression
andInteger
, not for direct use. Plus by explicitly callingsage.symbolic.units.is_unit()
, you should know what you're doing. However theis_*
functions are deprecated from the global namespace (not to mention that it seems like this is not even in the global namespace) and this might even be a simple enough function that it can be removed, see #12824.Thus I'm thinking this ticket should be closed, but a small patch to change the name might not hurt...