Skip to content

Conversation

delatrie
Copy link
Contributor

Context

#830 introduces proper typing annotations for allure.step via @typing.overload.

This PR removes the annotations from the implementation as per the Python docs:

The @overload-decorated definitions are for the benefit of the type checker only, since they will be overwritten by the non-@overload-decorated definition, while the latter is used at runtime but should be ignored by a type checker.

It also disables type checking of the wrapper function returned by StepContext.__call__ (it can't be typechecked without ParamSpec, which is only available in Python 3.10+).

@delatrie delatrie added the type:internal Change that isn't visible or obvious for end users label Mar 27, 2025
@delatrie delatrie force-pushed the step-typing-fixes branch from 668a490 to 51cf7ce Compare March 27, 2025 09:09
@delatrie delatrie merged commit e9003d0 into master Mar 27, 2025
48 checks passed
@delatrie delatrie deleted the step-typing-fixes branch March 27, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:core type:internal Change that isn't visible or obvious for end users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants