Mark recently documented methods as private
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Refs: https://github.com/pallets/click/pull/3030#discussion_r2291548633 https://github.com/pallets/click/pull/3030#discussion_r2291551517
authored by Kevin Deldycke · committed by Kevin Deldycke · parent 9f7d991 · Browse files · 1 file·+23 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Refs:
- https: //github.com/pallets/click/pull/3030#discussion_r2291548633
- https: //github.com/pallets/click/pull/3030#discussion_r2291551517
Diff stats
1 file+23 added−8 removed
- other:+23 added−8 removed
Provenance
- Commit
0acca45- Tree
d8b6f1c- Author
Kevin Deldycke <kevin@deldycke.com>- Committer
Kevin Deldycke <kevin@deldycke.com>- Parent
9f7d991
1 file changed+23 added−8 removed
modified:src/click/core.py+23 added-8 removed
2247 unmodified lines2248 sourced from the environment variable, the default map, or the parameter's2249 default value. In that order of precedence.2250 2251 If no value is found, an internal sentinel value is returned.2252+2253+ :meta private:2254 """2255 # Collect from the parse the value passed by the user to the CLI.2256 value = opts.get(self.name, UNSET) # type: ignore2257 # If the value is set, it means it was sourced from the command line by the80 unmodified lines2338 2339 return convert(value)2340 2341 def value_is_missing(self, value: t.Any) -> bool:2340- """2341- A value is considered missing if:2342+ """A value is considered missing if:2343 2344 - it is :attr:`UNSET`,2345 - or if it is an empty sequence while the parameter is suppose to have2346 non-single value (i.e. :attr:`nargs` is not ``1`` or :attr:`multiple` is2347 set).2348+2349+ :meta private:2350 """2351 if value is UNSET:2352 return True2353 14 unmodified lines2368 2369 .. versionchanged:: 8.32370 The :attr:`callback` gets an internal sentinel if the parameter was not set2371 by the user and no default was specified.2372+2373+ :meta private:2374 """2375 value = self.type_cast_value(ctx, value)2376 2377 if self.required and self.value_is_missing(value):25 unmodified lines2403 2404 The raw value extracted from the environment is not normalized and is2405 returned as-is. Any normalization or reconciliation is performed later by2406 the :class:`Parameter`'s :attr:`type`.2407+2408+ :meta private:2409 """2410 if not self.envvar:2411 return None2412 19 unmodified lines2432 2433 Returns the string as-is or splits it into a sequence of strings if the2434 parameter is expecting multiple values (i.e. its :attr:`nargs` property is set2435 to a value other than ``1``).2436+2437+ :meta private:2438 """2439 rv = self.resolve_envvar_value(ctx)2440 2441 if rv is not None and self.nargs != 1:11 unmodified lines2453 2454 If the parameter is deprecated, this method warn the user about it. But only if2455 the value has been explicitly set by the user (and as such, is not coming from2456 a default).2457+2458+ :meta private:2459 """2460 with augment_usage_errors(ctx, param=self):2461 value, source = self.consume_value(ctx, opts)2462 597 unmodified lines3060 :attr:`Context.auto_envvar_prefix`. If we could not find an environment from3061 the :attr:`envvar` property, we fallback on :attr:`Context.auto_envvar_prefix`3062 to build dynamiccaly the environment variable name using the3063 :python:`{ctx.auto_envvar_prefix}_{self.name.upper()}` template.3064+3065+ :meta private:3066 """3067 rv = super().resolve_envvar_value(ctx)3068 3069 if rv is not None:12 unmodified lines3082 3083 return None3084 3085 def value_from_envvar(self, ctx: Context) -> t.Any:3073- """3074- For :class:`Option`, this method processes the raw environment variable string3075- the same way as :func:`Parameter.value_from_envvar` does.3086+ """For :class:`Option`, this method processes the raw environment variable3087+ string the same way as :func:`Parameter.value_from_envvar` does.3088 3089 But in the case of non-boolean flags, the value is analyzed to determine if the3090 flag is activated or not, and returns a boolean of its activation, or the3091 :attr:`flag_value` if the latter is set.3092 3093 This method also takes care of repeated options (i.e. options with3094 :attr:`multiple` set to ``True``).3095+3096+ :meta private:3097 """3098 rv = self.resolve_envvar_value(ctx)3099 3100 # Absent environment variable or an empty string is interpreted as unset.25 unmodified lines3126 3127 def consume_value(3128 self, ctx: Context, opts: cabc.Mapping[str, Parameter]3129 ) -> tuple[t.Any, ParameterSource]:3116- """3117- For :class:`Option`, the value can be collected from an interactive prompt if3118- the option is a flag that needs a value (and the :attr:`prompt` property is3130+ """For :class:`Option`, the value can be collected from an interactive prompt3131+ if the option is a flag that needs a value (and the :attr:`prompt` property is3132 set).3133 3134 Additionally, this method handles flag option that are activated without a3135 value, in which case the :attr:`flag_value` is returned.3136+3137+ :meta private:3138 """3139 value, source = super().consume_value(ctx, opts)3140 3141 # The parser will emit a sentinel value if the option is allowed to as a flag158 unmodified lines