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 a new method whether base was correctly initialized #315

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

j-mracek
Copy link
Contributor

The methods is required in some applications with not exactly transparent work-flows.

Resolves: #310

@@ -87,6 +87,9 @@ class Base {
/// or Advisory query created.
void setup();

/// Returns true when setup() was not yet called.
bool require_setup();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name sounds like you are telling the Base instance to require setup. Isn't setup_required() or even is_setup_required() better?
Personally I'd prefer function that returns true in case the base object is correctly initialized - is_set_up(), is_setup_complete(), is_ready()...

Copy link
Member

@jan-kolarik jan-kolarik Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I definitely also vote for some "sentence-like" name, f.e. is_setup_completed() or is_setup_required() based on the logic underneath.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for suggestions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about is_base_initialized?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about is_base_initialized?

Sounds good, but as it is a method on the base object I would use just is_initialized.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with is_initialized. The base part in name is redundant here.

The methods is required in some applications with not exactly
transparent work-flows.

Resolves: rpm-software-management#310
@m-blaha
Copy link
Member

m-blaha commented Feb 22, 2023

Thanks, looks good.

@m-blaha m-blaha merged commit e892f87 into rpm-software-management:main Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python: allow checking whether a Base object has been setup
3 participants