Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the signatures of @(async)contextmanager #12087

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Sachaa-Thanasius
Copy link
Contributor

@Sachaa-Thanasius Sachaa-Thanasius commented Jun 2, 2024

A continuation of the work and discussion in #2772, #2773, #7430, and #8698. Seemingly unblocked by #11867.

This attempts to deprecate the current less restrictive and less accurate signatures of contextlib.(async)contextmanager using the deprecated decorator to provide users with a transition period (hopefully with less type checker screaming than in previous attempts). The text currently in deprecated() could be modified to convey a time period as well if that could be agreed upon, e.g. "will be disallowed in (3.14 | 6 months | 1 year)".

Additional Rationale
I'm not aware if there're any problems with using deprecated in this manner, but if so, this might be as good a place as any to inspire such a discussion. I'd argue it's not the worst idea, since technically typeshed's signatures for these functions have been inconsistent with the runtime for ages. Thus, even if this usage isn't based on a runtime change as other uses of deprecated seem to be, it can still do what it's meant to: provide some sort of user feedback on a use case being explicitly less accurate or less valid, and potentially mark a predefined time frame for transitioning from one to the other.

Considering a major blocker in previous attempts to fix the signatures was the amount of "breakage" it would cause, this feels softer, arguably too soft if maintainers don't have the right flag set in their type checkers to generate a "deprecated" warning error. Still, it's better than before; at least with the right type checker setting on, there's some signal of the more correct signature.

Potential Improvements and/or Alternatives

  • In the undeprecated overload, we could use custom protocols that aren't as narrow as (Async)Generator in place of the current parameter annotations, as outlined here. They would need to support __(a)next__(), (a)throw(), and probably now (a)close(), based on what's used at runtime. Something like this, perhaps, going off of the linked example:

    # The protocol names are wide open for bikeshedding.
    class ThrowableIterator(Protocol[_T]):
        def __next__(self) -> _T: ...
        # Note: The most accurate annotated signature for 'throw()' seem to require overloads,
        # if we're going off of 'Generator.throw()', but for the sake of being more succinct,
        # they aren't included here.
        def throw(
            self,
            exc_type: type[BaseException] | None,
            exc_inst: BaseException | None,
            exc_tb: TracebackType | None,
        ) -> Any: ...
        # The use of '(a)close()' in '(async)contextmanager' was backported all the way to 3.11.
        # See https://github.com/python/cpython/issues/110378.
        if sys.version_info >= (3, 11):
            def close(self) -> None: ...
            
    class AsyncThrowableIterator(Protocol[_T]): ...  # The async counterpart methods would be in here.
  • We can use sys.version_info to mark a clear cutoff point where the signature would no longer be "acceptable". From what I can tell, typeshed doesn't have an explicit deprecation policy for this kind of case, though this might be one way to implement it were it to exist. For example:

    if sys.version_info >= (3, 14):
        # Keep just the accurate signature here.
    else:
        # Keep the new overload and 'deprecated' overload here, or just the original signature
        # if the former isn't accepted.

    I feel like this case might be exceptional enough to warrant explicit deprecation cutoff points like this, given the concern about breakage before and how long the incorrect signature has existed without anything like a fix merged (the first issue linked above is over 5 years old now, for reference).

  • We can perform other actions outside of this PR to signal and help with the transition, e.g. pin an informational issue in the issue tracker commenting on the change, the reasons why, and how to adjust.

This comment has been minimized.

@Sachaa-Thanasius Sachaa-Thanasius changed the title Partially deprecate the signature of @contextmanager Fix the signatures of @(async)contextmanager Jun 2, 2024

This comment has been minimized.

@Sachaa-Thanasius Sachaa-Thanasius marked this pull request as ready for review June 2, 2024 20:54
@Sachaa-Thanasius Sachaa-Thanasius deleted the contexmanager/deprecate-iterator-signature branch June 2, 2024 22:53
@Sachaa-Thanasius Sachaa-Thanasius restored the contexmanager/deprecate-iterator-signature branch June 2, 2024 22:54
@Sachaa-Thanasius
Copy link
Contributor Author

Whoops. Learned something new about renaming branches today. Sorry about that.

This comment has been minimized.

@TeamSpen210
Copy link
Contributor

Mypy doesn't yet support @deprecated, so mypy_primer is just going to output nothing regardless of the actual impact. That probably needs to be a prerequisite.

@Sachaa-Thanasius
Copy link
Contributor Author

Sachaa-Thanasius commented Jun 2, 2024

Huh, didn't know that. I thought typeshed had an unofficial policy to not use typing-related symbols until a majority of the supported type checkers supported them, so I assumed mypy understood it

EDIT: I knowdeprecated is technically not just typing related, but type checkers still need to implement support for it, so it counts here.

@Sachaa-Thanasius
Copy link
Contributor Author

Sachaa-Thanasius commented Jun 3, 2024

Is there any chance mypy_primer could be run here with a different type checker, e.g. pyright, to gauge the impact (EDIT: maybe once with the type checker-specific deprecation flag on vs. off)? AFAIK, the type checker it runs with can be switched, though I don’t know how much trouble this type of adjustment & run would be.

@JelleZijlstra
Copy link
Member

I thought typeshed had an unofficial policy to not use typing-related symbols until a majority of the supported type checkers supported them

We don't use features that major type checkers will error on, but mypy just ignores the @deprecated decorator, so it's fine to use it even if mypy doesn't support it.

@Sachaa-Thanasius
Copy link
Contributor Author

Ah, gotcha. I guess that last primer run was valid, then.

stdlib/contextlib.pyi Outdated Show resolved Hide resolved
@AlexWaygood
Copy link
Member

AlexWaygood commented Jun 3, 2024

hopefully with less type checker screaming than in previous attempts

I think you'll get exactly the same amount of type-checker screaming. It's just that they'll be screaming about the signature being "deprecated" rather than it being "incorrect". But that still manifests itself as "the type checker is suddenly and unexpectedly failing in CI" in exactly the same way as an error telling you that the signature was incorrect. So I think the amount of disruption that this would cause is exactly the same.

For mypy, it would of course cause 0 disruption right now, since mypy doesn't yet support @deprecated, but I'd imagine this would cause a huge amount of disruption for pyright users and users of other type checkers that support @deprecated.

@Sachaa-Thanasius
Copy link
Contributor Author

Sachaa-Thanasius commented Jun 3, 2024

(Note: Most of my understanding of how type-checkers would visibly react to the presence of @deprecated is based on pyright's current behavior as part of Pylance.)

Cheers for the feedback! It made me realize that I made an incorrect assumption and didn't test it; for some reason, I thought the original suggestion this PR stems from — the direct swap to Generator — would propagate through all the call sites of the decorated function. Either way, it would just be the @(async)contextmanager decorator that's marked as "used in error", so to speak, so the same amount of surface area would be marked by a type checker. Got it.

Still, I think there would be a major difference in the potential disruption compared to before: The "deprecated" error would have its own dedicated configurable flag in one's type checker of choice, and that flag isn't fundamental enough to be turned on by default in people's CI systems across all uses of those type checkers. Pyright, for instance, currently has reportDeprecated on only in strict mode, assuming one isn't more granular in their configuration. Still, that setting is relatively simple to adjust according to one's needs. As a result, the level of effort required to consciously ignore the "deprecation" is much lower as a result (which is arguably a detriment, but for the sake of not causing as much disruption, it's technically a plus).

I will admit, I haven't checked what the mypy team's plans are with their own deprecation-related setting, e.g. whether it will be disabled by default; however, if it is off by default, that would also give projects more freedom to make changes according to deprecations like this at their own pace while not breaking CI as much. Basically, I'm trying to posit that if the relevant flag isn't enabled by default across type checkers, then this idea becomes a lot less likely to trigger type checker CI warnings on a large scale than the original annotation swap does, making it better than nothing.

This comment has been minimized.

Co-authored-by: Akuli <18505570+Akuli@users.noreply.github.com>

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Aug 2, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [R, P`2069] builds(cls, type[BuildsWithSig[type[R], P]], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [R, P`2091] builds(cls, type[BuildsWithSig[type[R], P]], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`2071, R] builds(cls, Callable[P, R], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`2093, R] builds(cls, Callable[P, R], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`2086, R, Importable] builds(cls, Callable[P, R] | type[Builds[Importable]] | Importable, /, *pos_args: T, zen_partial: bool | None, populate_full_signature: bool = ..., zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[type[DataClass_], ...] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ..., **kwargs_for_target: T) -> type[Builds[Importable]] | type[ZenPartialBuilds[Importable]] | type[HydraPartialBuilds[Importable]] | type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`2108, R, Importable] builds(cls, Callable[P, R] | type[Builds[Importable]] | Importable, /, *pos_args: T, zen_partial: bool | None, populate_full_signature: bool = ..., zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[type[DataClass_], ...] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ..., **kwargs_for_target: T) -> type[Builds[Importable]] | type[ZenPartialBuilds[Importable]] | type[HydraPartialBuilds[Importable]] | type[BuildsWithSig[type[R], P]]
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [R, P`3828] builds(cls, type[BuildsWithSig[type[R], P]], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [R, P`3850] builds(cls, type[BuildsWithSig[type[R], P]], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`3830, R] builds(cls, Callable[P, R], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`3852, R] builds(cls, Callable[P, R], /, *, zen_partial: Literal[False] | None = ..., populate_full_signature: Literal[True], zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[()] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ...) -> type[BuildsWithSig[type[R], P]]
- src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`3845, R, Importable] builds(cls, Callable[P, R] | type[Builds[Importable]] | Importable, /, *pos_args: T, zen_partial: bool | None, populate_full_signature: bool = ..., zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[type[DataClass_], ...] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ..., **kwargs_for_target: T) -> type[Builds[Importable]] | type[ZenPartialBuilds[Importable]] | type[HydraPartialBuilds[Importable]] | type[BuildsWithSig[type[R], P]]
+ src/hydra_zen/structured_configs/_implementations.py:1130: note:     def [P`3867, R, Importable] builds(cls, Callable[P, R] | type[Builds[Importable]] | Importable, /, *pos_args: T, zen_partial: bool | None, populate_full_signature: bool = ..., zen_wrappers: Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None] = ..., zen_meta: Mapping[str, SupportedPrimitive] | None = ..., hydra_recursive: bool | None = ..., hydra_convert: Literal['none', 'partial', 'all', 'object'] | None = ..., hydra_defaults: list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None = ..., dataclass_name: str | None = ..., builds_bases: tuple[type[DataClass_], ...] = ..., zen_dataclass: DataclassOptions | None = ..., frozen: bool = ..., zen_convert: ZenConvert | None = ..., **kwargs_for_target: T) -> type[Builds[Importable]] | type[ZenPartialBuilds[Importable]] | type[HydraPartialBuilds[Importable]] | type[BuildsWithSig[type[R], P]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants