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

Added bytes type and some inference #13061

Merged
merged 6 commits into from
Aug 22, 2024
Merged

Conversation

teofr
Copy link
Contributor

@teofr teofr commented Aug 22, 2024

Summary

This PR adds the bytes type to red-knot:

  • Added the bytes type
  • Added support for bytes literals
  • Support for the + operator

Improves on #12701

Big TODO on supporting and normalizing r-prefixed bytestrings (rb"hello\n")

Test Plan

Added a test for a bytes literals, concatenation, and corner values

Copy link
Contributor

github-actions bot commented Aug 22, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@teofr teofr changed the title [WIP] Added bytes type and some inference Added bytes type and some inference Aug 22, 2024
@teofr teofr marked this pull request as ready for review August 22, 2024 19:45
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

This is fantastic, thank you!!

crates/red_knot_python_semantic/src/types.rs Outdated Show resolved Hide resolved
@carljm carljm merged commit b9c8113 into astral-sh:main Aug 22, 2024
20 checks passed
@teofr teofr deleted the teofr/red_knot_bytes branch August 27, 2024 21:55
@carljm carljm added the red-knot Multi-file analysis & type inference label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants