Opened 6 years ago

Last modified 5 years ago

#18555 closed enhancement

Pickling and otherwise enhancing global options — at Version 4

Reported by: andrew.mathas Owned by:
Priority: major Milestone: sage-7.3
Component: interfaces Keywords: days78, options
Cc: ncohen, tscrim Merged in:
Authors: Andrew Mathas Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by andrew.mathas)

Instances of the GlobalOptions class in sage.structure.global_options do not pickle, which is annoying and causes various problems. (This is a defect.)

In addition, when the GlobalOptions class was introduced it was suggested in sage-dev that it "would be nice" if we could implement the syntax used in the IPython configuration:

    A.options.foobar = 1

in addition to

    A.options(foobar=1)

Implementing this is an enhancement, which is why this ticket is listed as an enhancement!

This (soon to be uploaded) patch will implement both of these features.

Change History (4)

comment:1 Changed 6 years ago by ncohen

  • Cc ncohen added

comment:2 Changed 6 years ago by andrew.mathas

  • Authors set to Andrew Mathas
  • Component changed from PLEASE CHANGE to interfaces
  • Description modified (diff)
  • Keywords options added
  • Summary changed from Pickling global options to Pickling and otherwise enhancing global options
  • Type changed from PLEASE CHANGE to enhancement

comment:3 Changed 6 years ago by andrew.mathas

As I am cleaning this up a related question comes to mind: the name GlobalOptions is slightly unfortunate because instances of this class are really just options for an associated family of objects. I can sort of forgive myself for using this name for the class, but in all of the instances of this class the associated "parent" classes have a global_options method that points back to its options class. This method is now being enshrined more firmly inside the code because it is exploited to allow pickling. I would be happier if these methods were simply called options, rather than global_options, even though this change would necessitate deprecating the existing global_options methods.

Thoughts?

Last edited 5 years ago by andrew.mathas (previous) (diff)

comment:4 Changed 6 years ago by andrew.mathas

  • Description modified (diff)
Note: See TracTickets for help on using tickets.