Skip to content

Comments

[red-knot] Test: Hashable/Sized => A/B#14769

Merged
sharkdp merged 1 commit intomainfrom
david/hashable-sized
Dec 4, 2024
Merged

[red-knot] Test: Hashable/Sized => A/B#14769
sharkdp merged 1 commit intomainfrom
david/hashable-sized

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Dec 4, 2024

Summary

Minor change that uses two plain classes A and B instead of typing.Sized and typing.Hashable.

The motivation is twofold: I remember that I was confused when I first saw this test. Was there anything specific to Sized and Hashable that was relevant here? (there is, these classes are not overlapping; and you can build a proper intersection from them; but that's true for almost all non-builtin classes).

I now ran into another problem while working on #14758: Sized and Hashable are protocols that we don't fully understand yet. This causing some trouble when trying to infer whether these are fully-static types or not.

@sharkdp sharkdp added the ty Multi-file analysis & type inference label Dec 4, 2024
assert_eq!(a_not_b.pos_vec(&db), &[a]);
assert_eq!(a_not_b.neg_vec(&db), &[b]);

// let's build
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// let's build
// let's build 👷

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@sharkdp sharkdp merged commit 948549f into main Dec 4, 2024
@sharkdp sharkdp deleted the david/hashable-sized branch December 4, 2024 14:00
dcreager added a commit that referenced this pull request Dec 4, 2024
* main:
  [red-knot] Test: Hashable/Sized => A/B (#14769)
  [`flake8-type-checking`] Expands TC006 docs to better explain itself (#14749)
  [`pycodestyle`] Handle f-strings properly for `invalid-escape-sequence (W605)` (#14748)
  [red-knot] Add fuzzer to catch panics for invalid syntax (#14678)
  Check `AIR001` from builtin or providers `operators` module (#14631)
  [airflow]: extend removed names (AIR302) (#14734)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants