Skip to content

Conversation

@MichaReiser
Copy link
Member

Summary

Increase the durability of read-only fields on File to HIGH

Test Plan

cargo test

@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label May 1, 2025
@MichaReiser MichaReiser changed the title [red-knot] Improve durability of File fields [red-knot] Increase durability of File fields May 1, 2025
@MichaReiser MichaReiser changed the title [red-knot] Increase durability of File fields [red-knot] Increase durability of read-only File fields May 1, 2025
@AlexWaygood AlexWaygood removed their request for review May 1, 2025 06:52
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.

Makes sense.

.status(FileStatus::Exists)
.revision(FileRevision::zero())
.permissions(None)
.permissions_durability(Durability::HIGH)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if permissions on a file do change? Do we treat them as immutable and ignore such changes? Do we not even watch for permission changes? I assume permissions aren't part of the file identity...

Copy link
Member Author

Choose a reason for hiding this comment

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

Virtual files don't have a permission, it's always set to None

@MichaReiser MichaReiser merged commit b7e69ec into main May 1, 2025
34 checks passed
@MichaReiser MichaReiser deleted the micha/increase-file-durability branch May 1, 2025 07:25
dcreager added a commit that referenced this pull request May 1, 2025
* main:
  Improve messages outputted by py-fuzzer (#17764)
  [`red-knot`] Allow subclasses of Any to be assignable to Callable types (#17717)
  [red-knot] Increase durability of read-only `File` fields (#17757)
  [red-knot] Cache source type during semanic index building (#17756)
  [`flake8-use-pathlib`] Fix `PTH116` false positive when `stat` is passed a file descriptor (#17709)
  Sync vendored typeshed stubs (#17753)
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.

3 participants