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

The 'nargs' argument to function() is undocumented #12817

Closed
orlitzky opened this issue Apr 7, 2012 · 3 comments
Closed

The 'nargs' argument to function() is undocumented #12817

orlitzky opened this issue Apr 7, 2012 · 3 comments

Comments

@orlitzky
Copy link
Contributor

orlitzky commented Apr 7, 2012

This could potentially be useful, but the docs only mention the following inputs:

  • Variable name(s)
  • latex_name
  • print_latex_func
sage: x,y = var('x,y')          
sage: f = function('f', nargs=1)
sage: f(x,y)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/mjo/src/sage-5.0.beta12/devel/sage-main/<ipython console> in <module>()

/home/mjo/src/sage-5.0.beta12/local/lib/python2.7/site-packages/sage/symbolic/function.so in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:3674)()

TypeError: Symbolic function f takes exactly 1 arguments (2 given)

Component: documentation

Reviewer: Lorenz Panny

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

@nbruin
Copy link
Contributor

nbruin commented Apr 7, 2012

comment:1

Note that sage.calculus.var.var and sage.calculus.var.function are just convenience wrappers of SR.var and sage.symbolic.function_factory.function_factory respectively. Both are augmented to inject the name they define into the global namespace and are therefore only suited for interactive use at sage's toplevel. In any more elaborate program or in library code, you should use the original functions.

The documentation of any of those can use improvement, but I'm not sure you want to explain all options in all of their docstrings. Perhaps a good cross reference can save some work.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe
Copy link
Member

mkoeppe commented Sep 6, 2021

comment:6

outdated, can close

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Sep 6, 2021
@yyyyx4
Copy link
Member

yyyyx4 commented Sep 6, 2021

Reviewer: Lorenz Panny

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