Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6e24935

Browse files
pre-commit-ci[bot]cclauss
andauthored
[pre-commit.ci] pre-commit autoupdate (#12234)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.0](astral-sh/ruff-pre-commit@v0.6.9...v0.7.0) - [github.com/tox-dev/pyproject-fmt: 2.3.0 → 2.4.3](tox-dev/pyproject-fmt@2.3.0...2.4.3) - [github.com/abravalheri/validate-pyproject: v0.20.2 → v0.21](abravalheri/validate-pyproject@v0.20.2...v0.21) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](pre-commit/mirrors-mypy@v1.11.2...v1.12.1) * project_euler/problem_047/sol1.py: def solution(n: int = 4) -> int | None: * Update sol1.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 03a4251 commit 6e24935

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

‎.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.6.9
19+
rev: v0.7.0
2020
hooks:
2121
- id: ruff
2222
- id: ruff-format
@@ -29,7 +29,7 @@ repos:
2929
- tomli
3030

3131
- repo: https://github.com/tox-dev/pyproject-fmt
32-
rev: "2.3.0"
32+
rev: "2.4.3"
3333
hooks:
3434
- id: pyproject-fmt
3535

@@ -42,12 +42,12 @@ repos:
4242
pass_filenames: false
4343

4444
- repo: https://github.com/abravalheri/validate-pyproject
45-
rev: v0.20.2
45+
rev: v0.21
4646
hooks:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.11.2
50+
rev: v1.12.1
5151
hooks:
5252
- id: mypy
5353
args:

‎project_euler/problem_047/sol1.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
def unique_prime_factors(n: int) -> set:
2525
"""
2626
Find unique prime factors of an integer.
27-
Tests include sorting because only the set really matters,
27+
Tests include sorting because only the set matters,
2828
not the order in which it is produced.
2929
>>> sorted(set(unique_prime_factors(14)))
3030
[2, 7]
@@ -58,7 +58,7 @@ def upf_len(num: int) -> int:
5858

5959
def equality(iterable: list) -> bool:
6060
"""
61-
Check equality of ALL elements in an iterable
61+
Check the equality of ALL elements in an iterable
6262
>>> equality([1, 2, 3, 4])
6363
False
6464
>>> equality([2, 2, 2, 2])
@@ -69,23 +69,23 @@ def equality(iterable: list) -> bool:
6969
return len(set(iterable)) in (0, 1)
7070

7171

72-
def run(n: int) -> list:
72+
def run(n: int) -> list[int]:
7373
"""
7474
Runs core process to find problem solution.
7575
>>> run(3)
7676
[644, 645, 646]
7777
"""
7878

7979
# Incrementor variable for our group list comprehension.
80-
# This serves as the first number in each list of values
80+
# This is the first number in each list of values
8181
# to test.
8282
base = 2
8383

8484
while True:
8585
# Increment each value of a generated range
8686
group = [base + i for i in range(n)]
8787

88-
# Run elements through out unique_prime_factors function
88+
# Run elements through the unique_prime_factors function
8989
# Append our target number to the end.
9090
checker = [upf_len(x) for x in group]
9191
checker.append(n)
@@ -98,7 +98,7 @@ def run(n: int) -> list:
9898
base += 1
9999

100100

101-
def solution(n: int = 4) -> int:
101+
def solution(n: int = 4) -> int|None:
102102
"""Return the first value of the first four consecutive integers to have four
103103
distinct prime factors each.
104104
>>> solution()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /