#4000: Implement QQ['x'] via Flint ZZ['x'] + denominator
---------------------------------------------------+------------------------
Reporter: malb | Owner: somebody
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.3.4
Component: basic arithmetic | Keywords:
Author: Sebastian Pancratz, Martin Albrecht | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------------------------------+------------------------
Comment(by malb):
Replying to [comment:57 spancratz]:
Hi, sorry for the late reply:
{{{
sage -t "devel/sage/sage/rings/polynomial/infinite_polynomial_element.py"
**********************************************************************
sage: type(Z._P)
Expected:
<class
'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict'>
Got:
<class
'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'>
**********************************************************************
}}}
If {{{Z._P}}} is over a domain, then yes change the doctest.
{{{
sage: sage.structure.parent.raise_attribute_error(QQ[x].gen(), "bla")
Expected:
Traceback (most recent call last):
...
AttributeError: 'Polynomial_rational_dense' object has no attribute
'bla'
Got:
Traceback (most recent call last):
File "/home/suser/sage-4.3.3/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/suser/sage-4.3.3/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/suser/sage-4.3.3/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_2[3]>", line 1, in <module>
sage.structure.parent.raise_attribute_error(QQ[x].gen(),
"bla")###line 162:
sage: sage.structure.parent.raise_attribute_error(QQ[x].gen(), "bla")
File "parent.pyx", line 169, in
sage.structure.parent.raise_attribute_error (sage/structure/parent.c:2611)
AttributeError:
'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_dense_flint'
object has no attribute 'bla'
}}}
Yes, you need to change the doctest.
{{{
Exception raised:
Traceback (most recent call last):
File "/home/suser/sage-4.3.3/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/suser/sage-4.3.3/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/suser/sage-4.3.3/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_3[8]>", line 1, in <module>
getattr_from_other_class(QQ[x].one(), A, "lazy_attribute")###line
220:
sage: getattr_from_other_class(QQ[x].one(), A, "lazy_attribute")
File "parent.pyx", line 245, in
sage.structure.parent.getattr_from_other_class
(sage/structure/parent.c:2953)
File "/home/suser/sage-4.3.3/local/lib/python/site-
packages/sage/misc/lazy_attribute.py", line 502, in __get__
setattr(a, self.f.__name__, result)
AttributeError:
'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_dense_flint'
object has no attribute 'lazy_attribute'
}}}
You probably need to implement {{{lazy_attribute}}}. I don't know what it
is supposed to be doing, so you should ask on [sage-devel].
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:58>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.