#17129: Posets constructor does not check argument
---------------------------------+------------------------
       Reporter:  jmantysalo     |        Owner:
           Type:  defect         |       Status:  new
       Priority:  trivial        |    Milestone:  sage-6.4
      Component:  combinatorics  |   Resolution:
       Keywords:                 |    Merged in:
        Authors:                 |    Reviewers:
Report Upstream:  N/A            |  Work issues:
         Branch:                 |       Commit:
   Dependencies:                 |     Stopgaps:
---------------------------------+------------------------
Changes (by jmantysalo):

 * cc: ncohen (added)


Comment:

 Is there some reason for ''not'' to check arguments on other functions?
 For example

 {{{
 Posets.RestrictedIntegerPartitions('cat-says-meow')
 Posets.SymmetricGroupBruhatIntervalPoset('cat-says-meow', 42)
 Posets.BooleanLattice('cat-says-meow')
 }}}

 will all give exception, but they output

 {{{
 ValueError: n must be an integer or be equal to one of None, NN,
 NonNegativeIntegers()

 ValueError: invalid literal for int() with base 10: ''

 TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'
 }}}

 Is right check just `if not n in ZZ: raise...`?

--
Ticket URL: <http://trac.sagemath.org/ticket/17129#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to