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

Don't use today() for default arguments #20501

Closed
jdemeyer opened this issue Apr 26, 2016 · 7 comments
Closed

Don't use today() for default arguments #20501

jdemeyer opened this issue Apr 26, 2016 · 7 comments

Comments

@jdemeyer
Copy link

The file src/sage/finance/stock.py contains this line

def history(self,startdate='Jan+1,+1900',enddate=date.today().strftime("%b+%d,+%Y"), histperiod='daily'):

The causes today's date to be hard-coded in the argspec and in the __doc__, which makes little sense. It is better to use None as default argument and then change None to today in the function body.

Note that doctests don't pass neither with or without this branch.

Component: finance

Author: Jeroen Demeyer

Branch/Commit: d81fbbd

Reviewer: Travis Scrimshaw

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

@jdemeyer jdemeyer added this to the sage-7.2 milestone Apr 26, 2016
@jdemeyer
Copy link
Author

Author: Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

@jdemeyer
Copy link
Author

New commits:

d81fbbdDon't use today() for default arguments

@jdemeyer
Copy link
Author

Commit: d81fbbd

@tscrim
Copy link
Collaborator

tscrim commented Apr 26, 2016

Reviewer: Travis Scrimshaw

@vbraun
Copy link
Member

vbraun commented Apr 27, 2016

Changed branch from u/jdemeyer/don_t_use_today___for_default_arguments to d81fbbd

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

3 participants