#11254: Using collections.defaultdict for evaluation_dict method for finite
words
-----------------------------+----------------------------------------------
Reporter: slabbe | Owner: slabbe
Type: PLEASE CHANGE | Status: new
Priority: major | Milestone: sage-4.7.1
Component: PLEASE CHANGE | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-----------------------------+----------------------------------------------
defaultdict allows to initialize automatically values of a dict to zero::
{{{
sage: from collections import defaultdict
sage: d = defaultdict(int)
sage: d['aa'] += 1
sage: d
defaultdict(<type 'int'>, {'aa': 1})
sage: d['bb'] = 9
sage: d
defaultdict(<type 'int'>, {'aa': 1, 'bb': 9})
}}}
It might be better to use this instead for {{{evaluation_dict}}} method of
finite words.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11254>
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.