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

[python] Inconsistencies with python str class and haxe Class type #11345

Open
theJenix opened this issue Oct 24, 2023 · 0 comments
Open

[python] Inconsistencies with python str class and haxe Class type #11345

theJenix opened this issue Oct 24, 2023 · 0 comments

Comments

@theJenix
Copy link
Contributor

theJenix commented Oct 24, 2023

This code

var x:Class<String> = String;
trace(Std.isOfType(str, Class)

compiles, but when run it prints False because of how isOfType is implemented on Python

I ran this issue when writing serialization logic where I needed to detect if a Dynamic is a Class object, where isOfType(x, Class) returned False where x is Python str. Ideally, isOfType could returns True for str and other python types that represent extern Haxe classes, or maybe just return if python_lib_Inspect.isclass returns True, but in either case I think this specific example should be consistent i.e. either str is a Class in which case isOfType should return True, or it"s not and that first line should not compile.

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

1 participant