Oscar Benjamin

Results 1706 comments of Oscar Benjamin

> It should be possible to reuse the [C implementation](https://github.com/python/cpython/blob/58ce131037ecb34d506a613f21993cde2056f628/Modules/_functoolsmodule.c#L783) of `functools.lru_cache` if we wanted something that was fixed size, but it would be a little pre-emptive IMO. We could...

The last two rebases were just because of merge conflicts after all the linting PRs and this time I pushed a commit to handle some remaining lint complaints in this...

It is simple enough to change the caching of the context later. The basic question that needs resolving is whether the context can be attached to an nmod as a...

> So we would change `any_to_fmpz` to somehting like `ZZ.any_to_fmpz` Yes, exactly. There can be a global `fmpz_ctx` object with a static `any_as_fmpz` method. Cases where the context is not...

> If you look at the C code generated here you can see that this final method ends up just being a normal C function as do any static methods:...

This completely breaks the build of python-flint: ``` $ spin test Invoking `build` prior to running tests: $ meson compile -C build INFO: autodetecting backend as ninja INFO: calculating backend...

The simple way to update Cython code for a GIL-free world is if the locking has a similar level of scope as the GIL did. For example a per-object lock...

This changes the returned value: ```console $ cat float.py import random from flint import fmpz for _ in range(100): x = random.getrandbits(1020) assert float(fmpz(x)) == float(x), x $ spin run...

It looks like gmpy2 does not use round-half-even: ```console $ cat float.py import random from gmpy2 import mpz for _ in range(100): x = random.getrandbits(54) assert float(mpz(x)) == float(x), x...

There was a test failure under PyPy: ``` File "/Users/runner/hostedtoolcache/PyPy/3.11.13/x64/lib/pypy3.11/site-packages/flint/types/fq_default.pypy311-pp73-darwin.so", line 270, in flint.types.fq_default.fq_default_ctx.gen Failed example: gf.gen() Expected: w Got: ``` The change here does not look like it could...