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

gmpy_cffi doesn't appear to have set_context #5

Open
dstromberg opened this issue Sep 24, 2023 · 0 comments
Open

gmpy_cffi doesn't appear to have set_context #5

dstromberg opened this issue Sep 24, 2023 · 0 comments

Comments

@dstromberg
Copy link

I have some code working on CPython with gmpy2, using mpfr: https://stromberg.dnsalias.org/svn/pybenoit/trunk

Sadly, when I try to run it on Pypy3 with gmpy_cffi, I get:

Traceback (most recent call last):
  File "./pybenoit", line 227, in <module>
    main()
  File "./pybenoit", line 185, in main
    mp.set_context(mp.context())
AttributeError: module 'gmpy_cffi' has no attribute 'set_context'

Is there a way to set a context with a caller-specified precision, using gmpy_cffi? I tried eliminating the set_context, but then mp.get_context().precision = 100 fails with:

Traceback (most recent call last):
  File "./pybenoit", line 227, in <module>
    main()
  File "./pybenoit", line 186, in main
    mp.get_context().precision = 100
AttributeError: module 'gmpy_cffi' has no attribute 'get_context'

I'm using CPython 3.9,2, Pypy3 7.3.9, and:

$ dpkg -l | egrep -i 'libgmp-dev|libmpfr-dev|libmpc-dev'
below cmd output started 2023 Sun Sep 24 10:08:36 AM PDT
ii  libgmp-dev:amd64                              2:6.2.1+dfsg-1+deb11u1
ii  libmpc-dev:amd64                              1.2.0-1
ii  libmpfr-dev:amd64                             4.1.0-3

Thanks! I'm kind of excited about the potential of gmpy_cffi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant