Deprecate provider.delegate() method

This commit is contained in:
Roman Mogylatov 2020-09-28 15:38:34 -04:00
parent 5d4eeb648a
commit 42b0bde8d2
3 changed files with 4455 additions and 4366 deletions

View File

@ -13,6 +13,7 @@ follows `Semantic versioning`_
- Deprecate ``ext.aiohttp`` module.
- Deprecate ``ext.flask`` module.
- Remove deprecated ``types`` module.
- Deprecate ``.delegate()`` provider method in favor of ``.provider`` attribute.
- Add ``sanic`` example.
- Update ``aiohttp`` example.
- Update ``flask`` example.

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@ import re
import sys
import types
import threading
import warnings
import weakref
try:
@ -257,6 +258,11 @@ cdef class Provider(object):
:rtype: :py:class:`Delegate`
"""
warnings.warn(
'Method ".delegate()" is deprecated since version 4.0.0. '
'Use ".provider" attribute instead.',
category=DeprecationWarning,
)
return Delegate(self)
@property