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

Add base classes SingletonObject and StrictSingletonObject #7

Closed
dangle opened this issue Nov 17, 2017 · 1 comment
Closed

Add base classes SingletonObject and StrictSingletonObject #7

dangle opened this issue Nov 17, 2017 · 1 comment

Comments

@dangle
Copy link
Contributor

dangle commented Nov 17, 2017

Create a SingletonObject by creating a private metaclass that inherits from Singleton and _ObjectMeta and a metaclass for a StrictSingletonObject that inherits from Singleton and _StrictObjectMeta.

The proposed use case would be a global settings object:

from typet import SingletonObject, File

class _Configuration(SingletonObject):
    config: File = '~/.my_config'

settings = _Configuration()
@dangle dangle added this to the Release v1.0.0 milestone Nov 17, 2017
@dangle
Copy link
Contributor Author

dangle commented Nov 20, 2017

Closed in favor of #8

@dangle dangle closed this as completed Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant