Skip to content

Experiment: Override __class__ for Builtin types to shadow isinstance #347

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

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

EdwardJXLi
Copy link
Contributor

@EdwardJXLi EdwardJXLi commented Feb 6, 2025

This allows us to do isinstance(symbol, list) instead of isinstance(symbol, codegen.sdk.core.List)

This applies to changes to:

  • List
  • Dict
  • Tuple
  • String
  • Number
  • Boolean

@EdwardJXLi EdwardJXLi requested review from codegen-team and a team as code owners February 6, 2025 22:04
@EdwardJXLi EdwardJXLi requested review from christinewangcw and removed request for a team February 6, 2025 22:04
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files

@EdwardJXLi EdwardJXLi changed the title Experiment: Override __class__ for List and Dict types to shadow isinstance Experiment: Override __class__ for Builtin types to shadow isinstance Feb 7, 2025
@EdwardJXLi EdwardJXLi merged commit a9f81ea into develop Feb 7, 2025
23 of 24 checks passed
@EdwardJXLi EdwardJXLi deleted the eli-misc-cursed-types branch February 7, 2025 20:14
jayhack pushed a commit that referenced this pull request Feb 9, 2025
…nce` (#347)

This allows us to do `isinstance(symbol, list)` instead of
`isinstance(symbol, codegen.sdk.core.List)`

This applies to changes to:
- List
- Dict
- Tuple
- String
- Number
- Boolean
Copy link
Contributor

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

tkfoss pushed a commit that referenced this pull request Feb 10, 2025
…nce` (#347)

This allows us to do `isinstance(symbol, list)` instead of
`isinstance(symbol, codegen.sdk.core.List)`

This applies to changes to:
- List
- Dict
- Tuple
- String
- Number
- Boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants