From 1500055909f50cb9e53645d1983a726603f92d80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2026 00:00:57 +0200 Subject: [PATCH] Simplify implementation Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-pages-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sphinx.yml | 2 +- strings/capitalize.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 5f5a90ce1a2d..3f00094e0264 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -41,7 +41,7 @@ jobs: - run: uv sync --group=docs - uses: actions/configure-pages@v6 - run: uv run sphinx-build -c docs . docs/_build/html - - uses: actions/upload-pages-artifact@v4 + - uses: actions/upload-pages-artifact@v5 with: path: docs/_build/html diff --git a/strings/capitalize.py b/strings/capitalize.py index 628ebffc8852..32c0b1644ba5 100644 --- a/strings/capitalize.py +++ b/strings/capitalize.py @@ -13,12 +13,11 @@ def capitalize(sentence: str) -> str: >>> capitalize("") '' """ - if not sentence: - return "" # Capitalize the first character if it's a lowercase letter # Concatenate the capitalized character with the rest of the string - return sentence[0].upper() + sentence[1:] + # Slicing keeps this safe for empty strings. + return sentence[:1].upper() + sentence[1:] if __name__ == "__main__":