#11641: Implementation of decorator for combinatorial statistics and maps
-------------------------------------------+--------------------------------
Reporter: stumpc5 | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-pending
Component: combinatorics | Resolution:
Keywords: combinatorial statistic | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Christian Stump | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------+--------------------------------
Comment (by nbruin):
Replying to [comment:5 saliola]:
> Thanks for taking a look at the patch and the helpful suggestions. One
question:
>
> Replying to [comment:4 sluther]:
> > 1) Please don't use assert, raise ValueError instead.
>
> Why shouldn't one use assert?
- If input parameters are of the wrong type, it's usual to raise a
`TypeError`. It's good to raise errors that obey conventions, because that
helps writing appropriate `try ... except` clauses when needed.
- assert statements can be optimized away if `python -O` is selected, so
they are only suitable to assert conditions that are supposed to hold
anyway (and raise an early error if they don't, to help debugging)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11641#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.