mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Replace typing.optional with new annotations syntax (#5829)
* Replace typing.optional with new annotations syntax
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from math import gcd
|
||||
from typing import Union
|
||||
|
||||
|
||||
def pollard_rho(
|
||||
@@ -7,7 +8,7 @@ def pollard_rho(
|
||||
seed: int = 2,
|
||||
step: int = 1,
|
||||
attempts: int = 3,
|
||||
) -> Union[int, None]:
|
||||
) -> int | None:
|
||||
"""
|
||||
Use Pollard's Rho algorithm to return a nontrivial factor of ``num``.
|
||||
The returned factor may be composite and require further factorization.
|
||||
|
||||
Reference in New Issue
Block a user