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,4 +1,6 @@
|
||||
from typing import Any, Optional
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
class ContainsLoopError(Exception):
|
||||
@@ -8,7 +10,7 @@ class ContainsLoopError(Exception):
|
||||
class Node:
|
||||
def __init__(self, data: Any) -> None:
|
||||
self.data: Any = data
|
||||
self.next_node: Optional[Node] = None
|
||||
self.next_node: Node | None = None
|
||||
|
||||
def __iter__(self):
|
||||
node = self
|
||||
|
||||
Reference in New Issue
Block a user