#7842 closed enhancement (fixed)
Let attrcall objects accept further arguments
Reported by: | nthiery | Owned by: | nthiery |
---|---|---|---|
Priority: | major | Milestone: | sage-4.3.1 |
Component: | misc | Keywords: | attrcall |
Cc: | sage-combinat | Merged in: | sage-4.3.1.alpha2 |
Authors: | Nicolas M. Thiéry | Reviewers: | Mike Hansen |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The attached patch allows for the following:
sage: xseries = attrcall('series', x) sage: xseries(sin(x), 4) 1*x + (-1/6)*x^3 + Order(x^4)
This is used in #7753
Attachments (1)
Change History (7)
Changed 8 years ago by
comment:1 Changed 8 years ago by
- Status changed from new to needs_review
comment:2 follow-up: ↓ 3 Changed 8 years ago by
comment:3 in reply to: ↑ 2 Changed 8 years ago by
Replying to mhansen:
Another nice thing to have now that I think about it would be this syntax:
sage: xseries = attrcall.series(x) sage: xseries(sin(x), 4) 1*x + (-1/6)*x^3 + Order(x^4)
Your point is that this syntax gives a better visual hint about this being about method calls, right? So here, attrcall would be some sort of dummy object placeholder? Why not. Though I am a bit reluctant with having two syntaxes.
I'll make a new ticket for this so that that it'll backward-compatible with the old version.
Do you mind reviewing this first, so that we can get #7753 in?
I'll review your patch in return :-)
comment:4 Changed 8 years ago by
- Reviewers set to Mike Hansen
- Status changed from needs_review to positive_review
This patch looks good to me.
We should also maybe allow putting keywords in too at the "second stage".
comment:5 Changed 8 years ago by
- Merged in set to 4.3.1.alpha2
- Resolution set to fixed
- Status changed from positive_review to closed
comment:6 Changed 8 years ago by
- Merged in changed from 4.3.1.alpha2 to sage-4.3.1.alpha2
Another nice thing to have now that I think about it would be this syntax:
I'll make a new ticket for this so that that it'll backward-compatible with the old version.