Skip to content

Accept bool values for boltons slugify ascii flag - #16955

Open
Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-slugify-bool-overload
Open

Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-slugify-bool-overload

Conversation

@Lushiyao5

Copy link
Copy Markdown
Contributor

boltons.strutils.slugify() accepts an ascii flag supplied by a boolean variable. The existing overloads only accept known True and False literals. Add a fallback overload for a general bool, with str | bytes as the result. The default and literal cases retain their existing return types.

I verified runtime output for both values and checked positional and keyword calls with mypy. Before the patch mypy rejected both variable inputs. With the patch, all result type assertions and the updated stub pass.

This patch was prepared with assistance from OpenAI Codex.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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