Skip to content
Myr

Keep the change entry concise

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Deldycke · committed by Kevin Deldycke · parent 44c2bea · Browse files · 1 file+6 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Address: https://github.com/pallets/click/pull/3030/files#r2288963504

Diff stats

1 file+6 added−8 removed

  • other:+6 added−8 removed

1 file+6 added−8 removed

modified:src/click/core.py+6 added-8 removed
2144 unmodified lines
21452146 .. versionchanged:: 8.3.02147 Returns ``None`` for the :attr:`default` if it is :attr:`UNSET`.21482149 We explicitly hide the :attr:`UNSET` value to the user, as we choose to2150 make it an implementation detail. And because ``to_info_dict`` has been2151 designed for documentation purposes, we return ``None`` instead.21522149 .. versionadded:: 8.02150 """2151 return {2152 "name": self.name,
3 unmodified lines
2156 "type": self.type.to_info_dict(),2157 "required": self.required,2158 "nargs": self.nargs,2159 "multiple": self.multiple,2160 # We explicitly hide the :attr:`UNSET` value to the user, as we choose to2161 # make it an implementation detail. And because ``to_info_dict`` has been2162 # designed for documentation purposes, we return ``None`` instead.2163 "default": self.default if self.default is not UNSET else None,2164 "envvar": self.envvar,2165 }2166
578 unmodified lines
2745 def to_info_dict(self) -> dict[str, t.Any]:2746 """2747 .. versionchanged:: 8.3.02748 Returns ``None`` for the :attr:`flag_value` if it is :attr:`UNSET`.27502751 We explicitly hide the :attr:`UNSET` value to the user, as we choose to2752 make it an implementation detail. And because ``to_info_dict`` has been2753 designed for documentation purposes, we return ``None`` instead.2749 """2750 info_dict = super().to_info_dict()2751 info_dict.update(2752 help=self.help,2753 prompt=self.prompt,2754 is_flag=self.is_flag,2755 # We explicitly hide the :attr:`UNSET` value to the user, as we choose to2756 # make it an implementation detail. And because ``to_info_dict`` has been2757 # designed for documentation purposes, we return ``None`` instead.2758 flag_value=self.flag_value if self.flag_value is not UNSET else None,2759 count=self.count,2760 hidden=self.hidden,2761 )
511 unmodified lines