From 88b5eab1ac2c534bcd150246dba1d5f8465b066c Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Fri, 18 Oct 2024 21:54:31 +0800 Subject: [PATCH] casting to list doesn't seem necessary, remain iterator for lazy eval --- src/pymatgen/io/vasp/inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pymatgen/io/vasp/inputs.py b/src/pymatgen/io/vasp/inputs.py index 5686b5448fa..12301be972c 100644 --- a/src/pymatgen/io/vasp/inputs.py +++ b/src/pymatgen/io/vasp/inputs.py @@ -39,7 +39,7 @@ from pymatgen.util.typing import Kpoint, Tuple3Floats, Tuple3Ints, Vector3D if TYPE_CHECKING: - from collections.abc import Sequence + from collections.abc import Iterator, Sequence from typing import Any, ClassVar, Literal from numpy.typing import ArrayLike @@ -855,7 +855,7 @@ def from_str(cls, string: str) -> Self: Returns: Incar object """ - lines: list[str] = list(clean_lines(string.splitlines())) + lines: Iterator[str] = clean_lines(string.splitlines()) params: dict[str, Any] = {} for line in lines: for sline in line.split(";"):