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

coerce_binop errors with keyword arguments #14186

Closed
lftabera opened this issue Feb 26, 2013 · 13 comments
Closed

coerce_binop errors with keyword arguments #14186

lftabera opened this issue Feb 26, 2013 · 13 comments

Comments

@lftabera
Copy link
Contributor

On a coerced binary operator

@coerce_binop
__op__(x,y,**kwds)
}}

if y has to be coerced but x does not change its parent, the keyword arguments are not correctly passed.

A real example

{{{
sage: R1=QQ['x,y']
sage: R2=QQ['x,y,z']
sage: f=R1(1)
sage: h=R2(1)
sage: h.gcd(f,algorithm='modular')
TypeError                                 Traceback (most recent call last)
...
TypeError: algorithm algorithm not supported
}}}

Component: coercion

Keywords: coerce_binop, keyword

Author: Luis Felipe Tabera Alonso

Branch/Commit: u/lftabera/ticket/14186 @ 0cb642b

Reviewer: Robert Bradshaw, Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/14186

@lftabera
Copy link
Contributor Author

comment:1

It is a one-line fix.

By the way, if a binary method with keyword values that is not decorated

__op__(self, y, method='z')

One can call it with x.__op__(y, 'preferred_method')

But once it is decorated this is not possible and key=value arguments are mandatory. Is this inteded?

@lftabera
Copy link
Contributor Author

Author: Luis Felipe Tabera Alonso

@lftabera
Copy link
Contributor Author

comment:3

Attachment: coer_binop_keywords.patch.gz

Update patch to new coercion framework.

@robertwb
Copy link
Contributor

Reviewer: Robert Bradshaw

@robertwb
Copy link
Contributor

comment:4

Looks good to me.

@robertwb
Copy link
Contributor

comment:6

Lets make sure the tests pass though.

@lftabera
Copy link
Contributor Author

comment:8

Robert,

Could you please take a look to the ticket? It is a one liner, you claimed that looked good and after seven months, patchbot has not complained.

@lftabera
Copy link
Contributor Author

Branch: u/lftabera/ticket/14186

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 20, 2013

Commit: 0cb642b

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 20, 2013

Branch pushed to git repo; I updated commit sha1. New commits:

0cb642bTrac #14186 coerce_binop errors with keyword arguments

@tscrim
Copy link
Collaborator

tscrim commented Dec 21, 2013

comment:11

Looks good to me.

@lftabera
Copy link
Contributor Author

comment:13

Do not forget to add yoursef to the reviewers field

@lftabera
Copy link
Contributor Author

Changed reviewer from Robert Bradshaw to Robert Bradshaw, Travis Scrimshaw

@vbraun vbraun closed this as completed in 8c3ab6a Dec 21, 2013
tscrim pushed a commit to tscrim/sage that referenced this issue Jun 1, 2023
* develop: (101 commits)
  Updated Sage version to 6.1.beta2
  fix latex
  fix documentation
  minor typography
  Trac 13101: mark doctest as "long time"
  trac 13101 better doctest
  Trac 13101: Fix bug in enumerate_totallyreal_fields_all
  sagemath#9706: review patch.
  trac 9706: Propose new class structure
  Symbolic Chebyshev polynomials: reviewer patch
  trac 9706: Collective patch. Bugfixes, extensions, optimizations, documentation, doctests for chebyshev_T, chebyshev_U and base class for ortho polys
  Fixing Whitespace errors
  Use bash as SHELL for build/Makefile
  allow numpy arrays in list_plot, line, points
  Trac sagemath#12322: Add a doctest for the correct behavior introduced in trac sagemath#12737.
  Trac sagemath#14186 coerce_binop errors with keyword arguments
  trac sagemath#15553: Broken links in the doc of graph/ and numerical/
  Improve handling of make targets sage, csage, extcode, scripts
  Reorded all.py to match original (so fewer changes).
  Fixed minor typo in cobminat/crystals/letters.pyx.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants