Skip to content

Commit

Permalink
Merge pull request #349 from reagento/revert-347-feature/warn_self
Browse files Browse the repository at this point in the history
Revert "Warn on self missed"
  • Loading branch information
Tishka17 authored Jan 19, 2025
2 parents 3762026 + 283719f commit 6776a9f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/dishka/dependency_source/make_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from asyncio import iscoroutinefunction
from collections.abc import (
AsyncGenerator,
Expand Down Expand Up @@ -294,15 +293,6 @@ def _make_factory_by_function(
# add self to dependencies, so it can be easily removed
# if we will bind factory to provider instance
hints = {self.name: Any, **hints}
if not self or self.name is not None:
warnings.warn(
f"You are trying to use function `{source.__name__}` "
"without `self` argument "
"inside Provider class, it would be treated as method. "
"Consider wrapping it with `staticmethod`, "
"registering on a provider instance or adding `self`.",
stacklevel=5,
)
possible_dependency = hints.pop("return", _empty)

kw_dependency_keys = {
Expand Down

0 comments on commit 6776a9f

Please sign in to comment.