Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make _storage_format_specification a method. #641

Closed
josiah-wolf-oberholtzer opened this issue Apr 30, 2016 · 2 comments
Closed

Make _storage_format_specification a method. #641

josiah-wolf-oberholtzer opened this issue Apr 30, 2016 · 2 comments
Assignees
Labels

Comments

@josiah-wolf-oberholtzer
Copy link
Member

There are currently two format-related properties on AbjadObject subclasses:

  • _storage_format_specification
  • _repr_specification

When hasattr(..., '_storage_format_specification') is called on an AbjadObject subclass instance, the property is evaluated. Then, typically, the property is accessed. This effectively totals a double evaluation of configuring and instantiating a StorageFormatSpecification object.

We should convert all such properties to _get_...() methods to avoid these double evaluations triggered by hasattr().

@trevorbaca
Copy link
Member

In June 2017 _get_storage_format_specification() now exists.

There are what look to be ancient (and probably unused) references to _repr_specification in StorageFormatAgent:

tools/systemtools/StorageFormatAgent.py
85:            hasattr(self._client, '_repr_specification') or
306:            spec = getattr(self._client, '_repr_specification', None)
309:                via = '_repr_specification'
596:            '_repr_specification' in dir(self._client) or
597:            hasattr(self._client, '_repr_specification') or
609:            specification = getattr(self.client, '_repr_specification',
621:            specification = getattr(self.client, '_repr_specification',

Will leave issue open until _repr_specification references are removed from StorageFormatAgent.

trevorbaca added a commit that referenced this issue Jul 5, 2017
@trevorbaca
Copy link
Member

Done in 2.21.

trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
trevorbaca added a commit that referenced this issue Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants