@@ -2104,7 +2104,7 @@ def test_fmpz_mod_poly():
21042104 assert pow (f , 2 ** 60 , g ) == pow (pow (f , 2 ** 30 , g ), 2 ** 30 , g )
21052105 assert pow (R_gen , 2 ** 60 , g ) == pow (pow (R_gen , 2 ** 30 , g ), 2 ** 30 , g )
21062106
2107- # Check other typechecks for pow_mod
2107+ # Check other typechecks for pow_mod
21082108 assert raises (lambda : pow (f , - 2 , g ), ValueError )
21092109 assert raises (lambda : pow (f , 1 , "A" ), TypeError )
21102110 assert raises (lambda : pow (f , "A" , g ), TypeError )
@@ -2756,7 +2756,7 @@ def setbad(obj, i, val):
27562756 assert P ([1 , 1 ]) ** 2 == P ([1 , 2 , 1 ])
27572757 assert raises (lambda : P ([1 , 1 ]) ** - 1 , ValueError )
27582758 assert raises (lambda : P ([1 , 1 ]) ** None , TypeError )
2759-
2759+
27602760 # XXX: Not sure what this should do in general:
27612761 p = P ([1 , 1 ])
27622762 mod = P ([1 , 1 ])
@@ -2816,32 +2816,32 @@ def setbad(obj, i, val):
28162816
28172817def _all_mpolys ():
28182818 return [
2819- (flint .fmpz_mpoly , flint .fmpz_mpoly_ctx .get_context , flint .fmpz , False , flint .fmpz (0 )),
2820- (flint .fmpq_mpoly , flint .fmpq_mpoly_ctx .get_context , flint .fmpq , True , flint .fmpz (0 )),
2819+ (flint .fmpz_mpoly , flint .fmpz_mpoly_ctx .get , flint .fmpz , False , flint .fmpz (0 )),
2820+ (flint .fmpq_mpoly , flint .fmpq_mpoly_ctx .get , flint .fmpq , True , flint .fmpz (0 )),
28212821 (
28222822 flint .fmpz_mod_mpoly ,
2823- lambda * args , ** kwargs : flint .fmpz_mod_mpoly_ctx .get_context (* args , ** kwargs , modulus = 101 ),
2823+ lambda * args , ** kwargs : flint .fmpz_mod_mpoly_ctx .get (* args , ** kwargs , modulus = 101 ),
28242824 lambda x : flint .fmpz_mod (x , flint .fmpz_mod_ctx (101 )),
28252825 True ,
28262826 flint .fmpz (101 ),
28272827 ),
28282828 (
28292829 flint .fmpz_mod_mpoly ,
2830- lambda * args , ** kwargs : flint .fmpz_mod_mpoly_ctx .get_context (* args , ** kwargs , modulus = 100 ),
2830+ lambda * args , ** kwargs : flint .fmpz_mod_mpoly_ctx .get (* args , ** kwargs , modulus = 100 ),
28312831 lambda x : flint .fmpz_mod (x , flint .fmpz_mod_ctx (100 )),
28322832 False ,
28332833 flint .fmpz (100 ),
28342834 ),
28352835 (
28362836 flint .nmod_mpoly ,
2837- lambda * args , ** kwargs : flint .nmod_mpoly_ctx .get_context (* args , ** kwargs , modulus = 101 ),
2837+ lambda * args , ** kwargs : flint .nmod_mpoly_ctx .get (* args , ** kwargs , modulus = 101 ),
28382838 lambda x : flint .nmod (x , 101 ),
28392839 True ,
28402840 flint .fmpz (101 ),
28412841 ),
28422842 (
28432843 flint .nmod_mpoly ,
2844- lambda * args , ** kwargs : flint .nmod_mpoly_ctx .get_context (* args , ** kwargs , modulus = 100 ),
2844+ lambda * args , ** kwargs : flint .nmod_mpoly_ctx .get (* args , ** kwargs , modulus = 100 ),
28452845 lambda x : flint .nmod (x , 100 ),
28462846 False ,
28472847 flint .fmpz (100 ),
@@ -2944,7 +2944,7 @@ def quick_poly():
29442944 assert P ({(0 , 1 ): 3 }, ctx = ctx ) == ctx .from_dict ({(0 , 1 ): 3 })
29452945
29462946 if P is flint .fmpq_mpoly :
2947- ctx_z = flint .fmpz_mpoly_ctx .get_context ((("x" , 2 ),))
2947+ ctx_z = flint .fmpz_mpoly_ctx .get ((("x" , 2 ),))
29482948 assert quick_poly () == P (ctx_z .from_dict ({(0 , 0 ): 1 , (0 , 1 ): 2 , (1 , 0 ): 3 , (2 , 2 ): 4 }))
29492949 assert P (ctx_z .from_dict ({(0 , 0 ): 1 }), ctx = ctx ) == P ({(0 , 0 ): 1 }, ctx = ctx )
29502950
@@ -3314,8 +3314,8 @@ def test_fmpz_mpoly_vec():
33143314 for context , mpoly_vec in _all_mpoly_vecs ():
33153315 has_groebner_functions = mpoly_vec is flint .fmpz_mpoly_vec
33163316
3317- ctx = context .get_context ((("x" , 2 ),))
3318- ctx1 = context .get_context ((("x" , 4 ),))
3317+ ctx = context .get ((("x" , 2 ),))
3318+ ctx1 = context .get ((("x" , 4 ),))
33193319 x , y = ctx .gens ()
33203320
33213321 vec = mpoly_vec (3 , ctx )
@@ -3344,7 +3344,7 @@ def test_fmpz_mpoly_vec():
33443344 assert raises (lambda : vec .__setitem__ (0 , ctx1 .from_dict ({})), IncompatibleContextError )
33453345
33463346 if has_groebner_functions :
3347- ctx = context .get_context (("x" , "y" , "z" ))
3347+ ctx = context .get (("x" , "y" , "z" ))
33483348
33493349 # Examples here cannibalised from
33503350 # https://en.wikipedia.org/wiki/Gr%C3%B6bner_basis#Example_and_counterexample
@@ -3407,8 +3407,8 @@ def _all_polys_mpolys():
34073407 ))
34083408 yield P , S , [x , y ], is_field , characteristic
34093409
3410- for P , get_context , S , is_field , characteristic in _all_mpolys ():
3411- ctx = get_context (("x" , "y" ))
3410+ for P , get , S , is_field , characteristic in _all_mpolys ():
3411+ ctx = get (("x" , "y" ))
34123412 x , y = ctx .gens ()
34133413 assert isinstance (x , (
34143414 flint .fmpz_mpoly ,
@@ -4159,7 +4159,7 @@ def test_fq_default():
41594159
41604160 # p must be prime
41614161 assert raises (lambda : flint .fq_default_ctx (10 ), ValueError )
4162-
4162+
41634163 # degree must be positive
41644164 assert raises (lambda : flint .fq_default_ctx (11 , - 1 ), ValueError )
41654165
0 commit comments