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

Let get_class() return Variant instead of String #2317

Closed
MaaaxiKing opened this issue Feb 19, 2021 · 1 comment
Closed

Let get_class() return Variant instead of String #2317

MaaaxiKing opened this issue Feb 19, 2021 · 1 comment

Comments

@MaaaxiKing
Copy link

MaaaxiKing commented Feb 19, 2021

Describe the project you are working on

Reaction game

Describe the problem or limitation you are having in your project

I cannot get a class itself, I get the name of the class as type String and so cannot use is. I try to do if child is _class.get_class(): but the right operand of is is not of type class, it is a String.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

One could use the is keyword for that.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Variant get_class() const
If one would really need the String of the class, one could just do str(<Object.>get_class()).

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

Yes, it is very useful.

@Calinou
Copy link
Member

Calinou commented Feb 19, 2021

Duplicate of #391.

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

2 participants