Skip to content
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

gmpy2.mpq can not be initialized from a pair of Sage integers #27632

Closed
videlec opened this issue Apr 10, 2019 · 9 comments
Closed

gmpy2.mpq can not be initialized from a pair of Sage integers #27632

videlec opened this issue Apr 10, 2019 · 9 comments

Comments

@videlec
Copy link
Contributor

videlec commented Apr 10, 2019

works fine from integers

sage: gmpy2.mpq(12r)
mpq(12,1)
sage: gmpy2.mpq(12)
mpq(12,1)

but not for pairs

sage: gmpy2.mpq(2r,3r)
mpq(2,3)
sage: gmpy2.mpq(2,3)
Traceback (most recent call last):
...
TypeError: cannot convert object to mpq

upstream issue : aleaxit/gmpy#237

Depends on #27858

Upstream: Reported upstream. Developers acknowledge bug.

CC: @vinklein

Component: packages: standard

Keywords: thursdaysbdx

Issue created by migration from https://trac.sagemath.org/ticket/27632

@videlec videlec added this to the sage-8.8 milestone Apr 10, 2019
@vinklein
Copy link
Mannequin

vinklein mannequin commented Apr 10, 2019

comment:1

Indeed.

And it's clearly a gmpy2 issue :

>>> from gmpy2 import mpz
>>> import gmpy2
>>> class One:
...     def __mpz__(self): return mpz(1)
... 
>>> class Two:
...     def __mpz__(self): return mpz(2)
... 
>>> gmpy2.mpq(Two())
mpq(2,1)
>>> gmpy2.mpq(One(), Two())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot convert object to mpq

I will look at this.

@vinklein
Copy link
Mannequin

vinklein mannequin commented Apr 10, 2019

Upstream: Reported upstream. No feedback yet.

@vinklein

This comment has been minimized.

@vinklein
Copy link
Mannequin

vinklein mannequin commented Apr 11, 2019

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

@vinklein
Copy link
Mannequin

vinklein mannequin commented Apr 11, 2019

comment:3

As the next beta release is coming soon i don't think a patch is necessary

@vinklein
Copy link
Mannequin

vinklein mannequin commented Apr 11, 2019

Changed keywords from none to thursdaysbdx

@videlec
Copy link
Contributor Author

videlec commented Apr 11, 2019

comment:4

Good. Thank you of taking care of it!

@vinklein
Copy link
Mannequin

vinklein mannequin commented May 22, 2019

Dependencies: #27858

@vinklein
Copy link
Mannequin

vinklein mannequin commented Jun 6, 2019

comment:6

No point in keeping this ticket.
Unless one want to add some doctests to remember that the problem is fixed.

@vinklein vinklein mannequin added the s: needs review label Jun 6, 2019
@vinklein vinklein mannequin removed this from the sage-8.8 milestone Jun 6, 2019
@videlec videlec closed this as completed Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant