From f9e34dc2ecd3a8d79a4861b20d596cd1c3a7ac26 Mon Sep 17 00:00:00 2001 From: brentyi Date: Fri, 11 Oct 2024 00:18:43 -0700 Subject: [PATCH] Appease mypy --- src/tyro/_fields.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tyro/_fields.py b/src/tyro/_fields.py index 8bfb2f30..ec4127f6 100644 --- a/src/tyro/_fields.py +++ b/src/tyro/_fields.py @@ -44,6 +44,7 @@ is_typeddict, ) +from . import conf # Avoid circular import. from . import ( _docstrings, _instantiators, @@ -51,7 +52,6 @@ _singleton, _strings, _unsafe_cache, - conf, # Avoid circular import. ) from ._typing import TypeForm from .conf import _confstruct, _markers @@ -960,9 +960,10 @@ def _try_field_list_from_general_callable( params = params[1:] # If a default is provided: either all or none of the arguments must be passed in. - markers = () if default_instance not in MISSING_SINGLETONS: markers = (_markers._OPTIONAL_GROUP,) + else: + markers = () with FieldDefinition.marker_context(markers): return _field_list_from_params(f, cls, params)