From 41c4039dd0c27f19cfc5d5db89283b868223f296 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 29 Oct 2024 10:55:06 -0700 Subject: [PATCH] use metaclass --- reflex/config.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index 6084d9022..db7bb0f6b 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -303,8 +303,22 @@ def interpret_env_var_value( ) -@dataclasses.dataclass(init=False) -class ExistingPath(Path): +class PathMeta(type): + """Metaclass for Path.""" + + def __getattr__(cls, name): + """Get the attribute from the Path class. + + Args: + name: The attribute name. + + Returns: + The attribute. + """ + return getattr(Path, name) + + +class ExistingPath(Path, metaclass=PathMeta): """A path that must exist."""