Skip to content

Commit 7fb13c2

Browse files
committed
refactor(ast): update variable typings for clarity
1 parent de8b655 commit 7fb13c2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fortls/parsers/internal/ast.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
class FortranAST:
2020
def __init__(self, file_obj=None):
2121
self.file = file_obj
22-
self.path: str = None
23-
if file_obj is not None:
24-
self.path = file_obj.path
22+
self.path: str | None = file_obj.path if file_obj is not None else None
2523
self.global_dict: dict = {}
2624
self.scope_list: list = []
2725
self.variable_list: list = []
@@ -39,10 +37,10 @@ def __init__(self, file_obj=None):
3937
self.none_scope = None
4038
self.inc_scope = None
4139
self.current_scope = None
42-
self.end_scope_regex: Pattern = None
43-
self.enc_scope_name: str = None
40+
self.end_scope_regex: Pattern | None = None
41+
self.enc_scope_name: str | None = None
4442
self.last_obj = None
45-
self.pending_doc: str = None
43+
self.pending_doc: str | None = None
4644

4745
def create_none_scope(self):
4846
"""Create empty scope to hold non-module contained items"""

0 commit comments

Comments
 (0)