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

Static typeAsString() enough? #1136

Open
agarny opened this issue Mar 2, 2023 · 1 comment
Open

Static typeAsString() enough? #1136

agarny opened this issue Mar 2, 2023 · 1 comment

Comments

@agarny
Copy link
Contributor

agarny commented Mar 2, 2023

We have PR #1131 that adds some static typeAsString() methods wherever needed. This is all good for people who want to retrieve a string version of a given type, but having used those methods a few times now, I find them a bit frustrating to use. In my use case, I just need to retrieve the type as a string of, say, a variable. So, I wish I could just do something like:
var->typeAsString() rather than have to do AnalyserVariable::typeAsString(var->type()).

So, in addition to our static typeAsString() methods, I would very much like to see a typeAsString() that returns the object's type as a string. Views? @hsorby @nickerso

@hsorby
Copy link
Contributor

hsorby commented Mar 6, 2023

I'm a bit worried about this being a gateway to people then asking for typeFromString API which I think is not something we want to do. The AnalyserVariable::typeAsString(var->type()) function is convenience for GUI widgets like comboboxes/selects.

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

No branches or pull requests

2 participants