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

preserve docstrings of decorated methods in multi_polynomial_ideal.py #2576

Closed
williamstein opened this issue Mar 17, 2008 · 5 comments
Closed

Comments

@williamstein
Copy link
Contributor


Hi,

How does one preserve the behavior of docstrings when using
decorators?  I just noticed, for example, that I couldn't easily
access the docstring of various things in rings/polynomial/
multi_polynomial_ideal.py because they have been decorated.  It is
unclear to me how to easily fix that - does anyone know a simple
solution?

Thanks,
M. Hampton

Component: documentation

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

@williamstein
Copy link
Contributor Author

this fixes one particular instance of the problem

@williamstein
Copy link
Contributor Author

comment:1

Attachment: sage-2576.patch.gz

To test the attached:

R.<x,y,z> = PolynomialRing(QQ, 3, order='lex')
p = z^2 + 1; q = z^3 + 2
I = (p*q^2, y-z^2)*R
pd = I.complete_primary_decomposition?

@williamstein williamstein changed the title preserve docstrings of decorated methods preserve docstrings of decorated methods in multi_polynomial_ideal.py Mar 17, 2008
@malb
Copy link
Member

malb commented Mar 17, 2008

comment:3

Michael Brickenstein on [sage-devel]:

By the way
wrapper.__name__=func.__name__
is usually also a good practice.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 18, 2008

comment:4

Replying to @williamstein:

To test the attached:

R.<x,y,z> = PolynomialRing(QQ, 3, order='lex')
p = z^2 + 1; q = z^3 + 2
I = (p*q^2, y-z^2)*R
pd = I.complete_primary_decomposition?

To test you need

R.<x,y,z> = PolynomialRing(QQ, 3, order='lex')
p = z^2 + 1; q = z^3 + 2
I = (p*q^2, y-z^2)*R
I.complete_primary_decomposition?

At least I did. Anyway, the patch applies and does what it is supposed to do. Positive review.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 18, 2008

comment:5

Merged in Sage 2.11.alpha0

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Mar 18, 2008
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

2 participants