Skip to content

Commit

Permalink
Appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Oct 11, 2024
1 parent 6f8d235 commit f9e34dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tyro/_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
is_typeddict,
)

from . import conf # Avoid circular import.
from . import (
_docstrings,
_instantiators,
_resolver,
_singleton,
_strings,
_unsafe_cache,
conf, # Avoid circular import.
)
from ._typing import TypeForm
from .conf import _confstruct, _markers
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f9e34dc

Please sign in to comment.