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

[Lang] [type] Add bool type in python as an alias to i32 #6742

Merged
merged 2 commits into from
Dec 3, 2022

Conversation

re-xyr
Copy link
Contributor

@re-xyr re-xyr commented Nov 26, 2022

Issue: #577 #6036

Brief Summary

This PR adds bool as an alias to ti.i32. Specifically,

  • x: bool is equivalent to x: i32
  • -> bool is equivalent to -> i32
  • bool(x) is equivalent to ti.cast(x, i32).

This is a temporary solution while we work towards a standalone bool type.

@netlify
Copy link

netlify bot commented Nov 26, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit c2480b9
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6381cadefa436a0008872430
😎 Deploy Preview https://deploy-preview-6742--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@re-xyr re-xyr requested a review from strongoier November 26, 2022 08:30
Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@strongoier strongoier merged commit 06ad09c into taichi-dev:master Dec 3, 2022
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
…6742)

Issue: taichi-dev#577 taichi-dev#6036

### Brief Summary

This PR adds `bool` as an alias to `ti.i32`. Specifically,

- `x: bool` is equivalent to `x: i32`
- `-> bool` is equivalent to `-> i32`
- `bool(x)` is equivalent to `ti.cast(x, i32)`.

This is a temporary solution while we work towards a standalone bool
type.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants