Opened 7 years ago
Closed 7 years ago
#17981 closed defect (fixed)
Fix when _coerce_map_from_ which returns a callable
Reported by: | tscrim | Owned by: | tscrim |
---|---|---|---|
Priority: | major | Milestone: | sage-6.6 |
Component: | coercion | Keywords: | |
Cc: | nbrun, vbraun, jdemeyer | Merged in: | |
Authors: | Travis Scrimshaw | Reviewers: | Darij Grinberg |
Report Upstream: | N/A | Work issues: | |
Branch: | b0973dc (Commits, GitHub, GitLab) | Commit: | b0973dc8b5d147adcd3b2e4451efa8b3dbeeb912 |
Dependencies: | Stopgaps: |
Description
The following currently results in an error:
sage: class P(Parent): ....: def __init__(self): ....: Parent.__init__(self, category=Sets()) ....: def _coerce_map_from_(self, A): ....: if A == ZZ: ....: return lambda x: self.element_class(self, x) ....: return False ....: Element = ElementWrapper ....: sage: X = P() sage: X.has_coerce_map_from(ZZ)
the reason is CallableConvertMap
is not being given the correct input data.
Change History (7)
comment:1 Changed 7 years ago by
- Branch set to public/coerce/fix_coerce_map_from_callable
- Commit set to b0973dc8b5d147adcd3b2e4451efa8b3dbeeb912
- Status changed from new to needs_review
comment:2 Changed 7 years ago by
- Status changed from needs_review to positive_review
comment:3 Changed 7 years ago by
Positive review (sorry, I should have written this half a day ago).
comment:5 Changed 7 years ago by
- Reviewers set to Darij Grinberg
- Status changed from needs_work to positive_review
comment:6 Changed 7 years ago by
Thanks Darij.
comment:7 Changed 7 years ago by
- Branch changed from public/coerce/fix_coerce_map_from_callable to b0973dc8b5d147adcd3b2e4451efa8b3dbeeb912
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
Fix coercion map when _coerce_map_from_ returns a callable.