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

Documentation for sum() function should indicate Python syntax *first* #9321

Closed
rlmill mannequin opened this issue Jun 24, 2010 · 23 comments
Closed

Documentation for sum() function should indicate Python syntax *first* #9321

rlmill mannequin opened this issue Jun 24, 2010 · 23 comments

Comments

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 24, 2010

When did we hijack the sum function? Based on the documentation there, I have (today alone) had four different people come up to me and ask why something like the following doesn't work:

sage: sum(Integer(x), x, 0, 9)

I know the reasons this shouldn't work, but newbies definitely don't. It should say something about how to do

sage: sum( Integer(x) for x in range(10) )

before "getting all symbolic."

CC: @kcrisman

Component: documentation

Author: Ralf Stephan

Branch/Commit: 5f47daf

Reviewer: Karl-Dieter Crisman, Travis Scrimshaw

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

@rlmill rlmill mannequin added c: documentation labels Jun 24, 2010
@rlmill rlmill mannequin assigned sagetrac-mvngu Jun 24, 2010
@rwst
Copy link
Contributor

rwst commented Mar 18, 2014

comment:2

The sagenb bug spreadsheet has several examples, too.

@rwst
Copy link
Contributor

rwst commented Mar 18, 2014

Branch: u/rws/ticket/9321

@rwst
Copy link
Contributor

rwst commented Mar 18, 2014

New commits:

228fd67Trac #9321: add warnings to sum() and symbolic_sum() documentation

@rwst
Copy link
Contributor

rwst commented Mar 18, 2014

Commit: 228fd67

@rwst
Copy link
Contributor

rwst commented Mar 18, 2014

Author: Ralf Stephan

@kcrisman
Copy link
Member

comment:6

Nice first step. I would also add some actual examples as the original reporter suggests - maybe with an explicit example showing what does and doesn't work along these lines.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Changed commit from 228fd67 to 09ba9b9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

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

09ba9b9examples when/not to use Sage sum(); same also in calculus.py

@rwst
Copy link
Contributor

rwst commented Mar 19, 2014

comment:8

How about this? Cannot make it any shorter than that.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

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

45fbd50fix doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Changed commit from 09ba9b9 to 45fbd50

@tscrim
Copy link
Collaborator

tscrim commented Mar 19, 2014

comment:10

Your warning messages are indented one too many times.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

Changed commit from 45fbd50 to eb0ddc0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2014

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

eb0ddc0too much indentation

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman, Travis Scrimshaw

@rwst
Copy link
Contributor

rwst commented Mar 19, 2014

comment:13

Thanks for the review.

@kcrisman
Copy link
Member

comment:14

Okay, I'm going to ask for one final thing. Probably it isn't appropriate to have this warning be before one even sees the INPUT block! Can you put this after the first few examples, and then have some wording indicating "now back to the examples" in a not-informal way? Otherwise we'll have the opposite problem of everyone avoiding this function :)

Also, another nit-pick - try to put the sum() in double back ticks so that it typesets properly as code. And... is there any general reference for the Python sum, or are all of them version-dependent? (I think the latter, just checking in case you know).

Thanks! Sorry this is an incremental review but it will be more awesomer soon.

@rwst
Copy link
Contributor

rwst commented Mar 20, 2014

Changed branch from u/rws/ticket/9321 to u/rws/new9321

@rwst
Copy link
Contributor

rwst commented Mar 20, 2014

comment:15

I moved the warning a bit lower and added necessary backticks. I also removed the version string from the python link, although you will still arrive at the 2.x version. It's no longer hardcoded however. Finally, I had to change the branch path because git amended commits are not accepted by sage -dev push.


New commits:

5f47dafmoved warning after some examples

@rwst
Copy link
Contributor

rwst commented Mar 20, 2014

Changed commit from eb0ddc0 to 5f47daf

@tscrim
Copy link
Collaborator

tscrim commented Jun 22, 2014

comment:16

Karl-Dieter, are you happy with the current version? (Really this is an elaborate ping.)

@kcrisman
Copy link
Member

comment:17

I also removed the version string from the python link, although you will still arrive at the 2.x version. It's no longer hardcoded however.

https://docs.python.org/{2,3}/library/functions.html#sum is the link, technically. I won't hold it up for that, though, since they can just click on "sum" from the big list at that location. Doc looks good now.

Karl-Dieter, are you happy with the current version? (Really this is an elaborate ping.)

:-) Sorry for the delay; I definitely have been having to cut back even on review time the past few months.

@vbraun
Copy link
Member

vbraun commented Jun 26, 2014

Changed branch from u/rws/new9321 to 5f47daf

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

4 participants