Opened 15 months ago

Closed 8 months ago

#30174 closed defect (fixed)

Trivial coercion Modules(QQ)(FiniteRankFreeModule(QQ, 3)) fails

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.3
Component: categories Keywords:
Cc: egourgoulhon, tscrim, gh-mjungmath Merged in:
Authors: Michael Jung Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 50ab4e3 (Commits, GitHub, GitLab) Commit: 50ab4e32e7a9b20b89cd6fbee6ae56888f61c85a
Dependencies: Stopgaps:

Status badges

Description

(from #30094)

sage: Q3 = FiniteRankFreeModule(QQ, 3)
sage: Q3 in Modules(QQ)
True
sage: Modules(QQ)(Q3)
TypeError: 'FiniteRankFreeModule_with_category' object has no attribute 'vector_space'
unable to coerce x (=3-dimensional vector space over the Rational Field) into Category of vector spaces over Rational Field

Compare with:

sage: Modules(QQ)(QQ^3)
Vector space of dimension 3 over Rational Field

Change History (10)

comment:1 Changed 15 months ago by mkoeppe

tscrim, #30094 comment 4:

My 2 cents for the error reported in the ticket is to first check that the object is not in the category. The other option is to lift the vector_space method up to the category of modules and then implement a change_ring method for Q3.

comment:2 Changed 14 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:3 Changed 8 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

comment:4 Changed 8 months ago by gh-mjungmath

  • Branch set to u/gh-mjungmath/trivial_coercion_modules_qq__finiterankfreemodule_qq__3___fails

comment:5 Changed 8 months ago by gh-mjungmath

  • Commit set to 1a4962d3f44daf64643b11553f6cbd05663e5bd2
  • Status changed from new to needs_review

That should solve it. __call__ is not supposed to be overwritten for children classes of Category.


New commits:

1a4962dTrac #30174: __call__ -> _call_

comment:6 Changed 8 months ago by git

  • Commit changed from 1a4962d3f44daf64643b11553f6cbd05663e5bd2 to 50ab4e32e7a9b20b89cd6fbee6ae56888f61c85a

Branch pushed to git repo; I updated commit sha1. New commits:

50ab4e3Trac #30174: add test to validate fix

comment:7 Changed 8 months ago by tscrim

  • Authors set to Michael Jung
  • Reviewers set to Travis Scrimshaw

LGTM once there is a green patchbot. Don't forget to add the author name.

comment:8 Changed 8 months ago by gh-mjungmath

Patchbot is green.

comment:9 Changed 8 months ago by tscrim

  • Milestone changed from sage-9.4 to sage-9.3
  • Status changed from needs_review to positive_review

comment:10 Changed 8 months ago by vbraun

  • Branch changed from u/gh-mjungmath/trivial_coercion_modules_qq__finiterankfreemodule_qq__3___fails to 50ab4e32e7a9b20b89cd6fbee6ae56888f61c85a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.