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

print(type(list)) prints nonsense #170

Open
markshannon opened this issue Jan 13, 2023 · 2 comments
Open

print(type(list)) prints nonsense #170

markshannon opened this issue Jan 13, 2023 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request typecheck Type-checker

Comments

@markshannon
Copy link

print(type(list))

codon run test.py

(item1: (), item2: ())

python3.11 test.py

<class 'type'>

This seems to apply to any type

class C: pass

print(type(C))

produces the same output

@arshajii
Copy link
Contributor

This has been an issue for a while... also happens with functions. @inumanag any way we can print these correctly?

@inumanag
Copy link
Contributor

inumanag commented Jan 13, 2023

Currently type returns a type variable (a compile-time static variable, not a runtime value), and print gets confused there. Will handle these cases in the future when runtime type reflection lands.

@inumanag inumanag added bug Something isn't working enhancement New feature or request typecheck Type-checker labels Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request typecheck Type-checker
Projects
None yet
Development

No branches or pull requests

3 participants