Skip to content

Commit 0907131

Browse files
committed
Prefer gens to from_dict
1 parent 5ee66e9 commit 0907131

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/flint/types/fmpz_mpoly.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,10 @@ cdef class fmpz_mpoly(flint_mpoly):
961961
962962
>>> from flint import Ordering
963963
>>> ctx = fmpz_mpoly_ctx.get_context(2, Ordering.lex, nametup=('x', 'y'))
964-
>>> f = ctx.from_dict({(3, 0): 2, (2, 1): -1, (0, 3): 1, (0, 1): 3})
965-
>>> g1 = ctx.from_dict({(2, 0): 1, (0, 2): 1, (0, 0): 1})
966-
>>> g2 = ctx.from_dict({(1, 1): 1, (0, 0): -2})
964+
>>> x, y = ctx.gens()
965+
>>> f = 2 * x**3 -x**2 * y + y**3 + 3 * y
966+
>>> g1 = x**2 + y**2 + 1
967+
>>> g2 = x * y - 2
967968
>>> vec = fmpz_mpoly_vec([g1, g2], ctx)
968969
>>> vec
969970
fmpz_mpoly_vec([x^2 + y^2 + 1, x*y - 2], ctx=fmpz_mpoly_ctx(2, '<Ordering.lex: 0>', ('x', 'y')))

0 commit comments

Comments
 (0)