MCPcopy
hub / github.com/pallets/click / to_info_dict

Method to_info_dict

src/click/core.py:3048–3065  ·  view source on GitHub ↗

.. versionchanged:: 8.3.0 Returns ``None`` for the :attr:`flag_value` if it was not set.

(self)

Source from the content-addressed store, hash-verified

3046 raise TypeError("'count' is not valid with 'is_flag'.")
3047
3048 def to_info_dict(self) -> dict[str, t.Any]:
3049 """
3050 .. versionchanged:: 8.3.0
3051 Returns ``None`` for the :attr:`flag_value` if it was not set.
3052 """
3053 info_dict = super().to_info_dict()
3054 info_dict.update(
3055 help=self.help,
3056 prompt=self.prompt,
3057 is_flag=self.is_flag,
3058 # We explicitly hide the :attr:`UNSET` value to the user, as we choose to
3059 # make it an implementation detail. And because ``to_info_dict`` has been
3060 # designed for documentation purposes, we return ``None`` instead.
3061 flag_value=self.flag_value if self.flag_value is not UNSET else None,
3062 count=self.count,
3063 hidden=self.hidden,
3064 )
3065 return info_dict
3066
3067 def get_default(
3068 self, ctx: Context, call: bool = True

Callers

nothing calls this directly

Calls 2

updateMethod · 0.80
to_info_dictMethod · 0.45

Tested by

no test coverage detected