Help on options decorator

11 views
Skip to first unread message

kcrisman

unread,
Jan 10, 2012, 3:37:15 PM1/10/12
to sage-devel
While reviewing #12214, I found something odd.


sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness':
0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue
sage: polygon2d.options['rgbcolor']=(1,0,0)
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks red
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness':
0}
sage: polygon2d.defaults()
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness':
0}
sage: polygon2d.reset()
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness':
0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue again like it
should

So, in sum, the options really do change and reset, but the printed
out version doesn't seem to.

Can someone who understands sage/misc/decorator.py better than I do
explain what's going on here? I'm really not sure where the printed
options dictionary is, and how it differs from the "real" one.

- kcrisman

kcrisman

unread,
Jan 12, 2012, 11:02:17 AM1/12/12
to sage-devel
Jason says that this was actually seen this summer in the PREP
workshop as well. Apparently the options decorator doesn't print
correctly. See #12300.
Reply all
Reply to author
Forward
0 new messages