Skip to content

Commit

Permalink
Merge pull request #24453 from michelececcacci/fix_list_explicit_kw
Browse files Browse the repository at this point in the history
Make polys arg explicit in `symmetric_poly()`
  • Loading branch information
sylee957 committed Dec 31, 2022
2 parents 8db0a98 + 04c46b7 commit 5ee2ecd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ Michael Sparapany <msparapa@purdue.edu>
Michael Zingale <michael.zingale@stonybrook.edu>
Michal Grňo <m93a.cz@gmail.com> Michal Grno <m93a.cz@gmail.com>
Michał Radwański <enedil.isildur@gmail.com>
Michele Ceccacci <michelececcacci1@gmail.com>
Michele Ceccacci <michelececcacci1@gmail.com> Michele Ceccacci <75946413+michelececcacci@users.noreply.github.com>
Michele Zaffalon <michele.zaffalon@gmail.com>
Micky <mickydroch@gmail.com>
Miguel Marco <mmarco@unizar.es>
Expand Down
19 changes: 10 additions & 9 deletions sympy/polys/specialpolys.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ def cyclotomic_poly(n, x=None, polys=False):


@public
def symmetric_poly(n, *gens, **args):
"""Generates symmetric polynomial of order `n`.
def symmetric_poly(n, *gens, polys=False):
"""
Generates symmetric polynomial of order `n`.
Parameters
==========
Returns a Poly object when ``polys=True``, otherwise
(default) returns an expression.
polys: bool, optional (default: False)
Returns a Poly object when ``polys=True``, otherwise
(default) returns an expression.
"""
# TODO: use an explicit keyword argument
gens = _analyze_gens(gens)

if n < 0 or n > len(gens) or not gens:
Expand All @@ -106,10 +110,7 @@ def symmetric_poly(n, *gens, **args):
else:
poly = Add(*[Mul(*s) for s in subsets(gens, int(n))])

if not args.get('polys', False):
return poly
else:
return Poly(poly, *gens)
return Poly(poly, *gens) if polys else poly


@public
Expand Down

0 comments on commit 5ee2ecd

Please sign in to comment.