#17191: Poset: change rank dict to rank array
-------------------------+-------------------------------------------------
Reporter: | Owner:
jmantysalo | Status: needs_work
Type: | Milestone: sage-wishlist
enhancement | Resolution:
Priority: minor | Merged in:
Component: | Reviewers: Jori Mäntysalo
combinatorics | Work issues:
Keywords: | Commit:
Authors: | 08727b253f8ecc25285f2e0c01a21424868bcf63
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/17191 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by ncohen):
Yooo !
> {{{
> return lambda x:self._rank[x] # the rank function is just the getitem of
the dict
> }}}
>
> The comment string should be changed, "dict" -> "list". Also why bother
with lambda function, because lists also has a `__getitem__`?
You are right.
> {{{
> return [rank_fcn[i] for i in range(self.order())]
> }}}
>
> seems strange --- isn't that just same as `return rank_fcn` or `return
copy(rank_fcn)`? Or maybe I didn't understand this.
Because `rank_fcn` is a dictionary, not a list, and because it should be a
dictionary in this function (because of lines like 'if x in rank_fcn').
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/17191#comment:4>
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.