Repository navigation
Update #3078 - Force any non-NoneType to string - #3090
Merged
Merged
Conversation
Contributor
Author
|
Concerning that change. It's just to ensure that escaping will not generate more break, but we are agree that clients code must properly handle passed values. One doesn't preclude the other I think. I let you choose if it must be harden here or not. |
Collaborator
|
Thanks, merged! Note a huge fan of adding type annotations but given the trouble here, and increased use of AI bots, I think it's ok to gradually introduce type hints - any thoughts @birkenfeld ? |
Member
|
Yeah, it seems to be the trend nowadays, I've trained myself to not care about it anymore :) |
This was referenced May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @Anteru , @birkenfeld ,
Following up #3078 (which fixes #3076), I would like to improve a quite bite the
html_escapefunction for the 2.20.1 release.@Anteru you said in #3078:
I found this issue recently that would justify strong types : lepture/shibuya#113
This time an
inttype is initiated. Some attributes fromHtmlFormatterdefinitely shouldn't be inititiated with other types than string (right?), but I suggest, as you mentioned it above @Anteru , to force strong typestrwhen it's notNoneType, then no more of this kind of issue may be raised.