Skip to content

Constrain type of WhiteNoise.index_file#440

Merged
adamchainz merged 1 commit into
mainfrom
inline_index_logic
Nov 3, 2022
Merged

Constrain type of WhiteNoise.index_file#440
adamchainz merged 1 commit into
mainfrom
inline_index_logic

Conversation

@adamchainz

Copy link
Copy Markdown
Collaborator

Split from #410. Previously this could be str | bool | None, now it's just str | None. This makes it easier to use type narrowing like self.index_file is not None.

Also inline the index file logic, so that type narrowing applies. I also find it easier to follow without tons of functions to jump between.

@adamchainz adamchainz merged commit 636cd37 into main Nov 3, 2022
@adamchainz adamchainz deleted the inline_index_logic branch November 3, 2022 10:21
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.

1 participant