bpo-28886: doc: Move deprecated abc decorators to separate section (G… · python/cpython@0150dc5 (original) (raw)

`` @@ -160,7 +160,7 @@ a helper class :class:ABC to alternatively define ABCs through inheritance:

``

160

160

``

161

161

``

162

162

``

163

``

`` -

The :mod:abc module also provides the following decorators:

``

``

163

`` +

The :mod:abc module also provides the following decorator:

``

164

164

``

165

165

`.. decorator:: abstractmethod

`

166

166

``

`` @@ -236,8 +236,15 @@ The :mod:abc module also provides the following decorators:

``

236

236

` multiple-inheritance.

`

237

237

``

238

238

``

``

239

`` +

The :mod:abc module also supports the following legacy decorators:

``

``

240

+

239

241

`.. decorator:: abstractclassmethod

`

240

242

``

``

243

`+

.. versionadded:: 3.2

`

``

244

`+

.. deprecated:: 3.3

`

``

245

`` +

It is now possible to use :class:classmethod with

``

``

246

`` +

:func:abstractmethod, making this decorator redundant.

``

``

247

+

241

248

`` A subclass of the built-in :func:classmethod, indicating an abstract

``

242

249

`` classmethod. Otherwise it is similar to :func:abstractmethod.

``

243

250

``

`` @@ -251,14 +258,14 @@ The :mod:abc module also provides the following decorators:

``

251

258

` def my_abstract_classmethod(cls, ...):

`

252

259

` ...

`

253

260

``

``

261

+

``

262

`+

.. decorator:: abstractstaticmethod

`

``

263

+

254

264

` .. versionadded:: 3.2

`

255

265

` .. deprecated:: 3.3

`

256

``

`` -

It is now possible to use :class:classmethod with

``

``

266

`` +

It is now possible to use :class:staticmethod with

``

257

267

`` :func:abstractmethod, making this decorator redundant.

``

258

268

``

259

``

-

260

``

`-

.. decorator:: abstractstaticmethod

`

261

``

-

262

269

`` A subclass of the built-in :func:staticmethod, indicating an abstract

``

263

270

`` staticmethod. Otherwise it is similar to :func:abstractmethod.

``

264

271

``

`` @@ -272,23 +279,17 @@ The :mod:abc module also provides the following decorators:

``

272

279

` def my_abstract_staticmethod(...):

`

273

280

` ...

`

274

281

``

275

``

`-

.. versionadded:: 3.2

`

276

``

`-

.. deprecated:: 3.3

`

277

``

`` -

It is now possible to use :class:staticmethod with

``

278

``

`` -

:func:abstractmethod, making this decorator redundant.

``

279

``

-

280

282

``

281

283

`.. decorator:: abstractproperty

`

282

284

``

``

285

`+

.. deprecated:: 3.3

`

``

286

`` +

It is now possible to use :class:property, :meth:property.getter,

``

``

287

`` +

:meth:property.setter and :meth:property.deleter with

``

``

288

`` +

:func:abstractmethod, making this decorator redundant.

``

``

289

+

283

290

`` A subclass of the built-in :func:property, indicating an abstract

``

284

291

` property.

`

285

292

``

286

``

`` -

Using this function requires that the class's metaclass is :class:ABCMeta

``

287

``

`-

or is derived from it. A class that has a metaclass derived from

`

288

``

`` -

:class:ABCMeta cannot be instantiated unless all of its abstract methods

``

289

``

`-

and properties are overridden. The abstract properties can be called using

`

290

``

`-

any of the normal 'super' call mechanisms.

`

291

``

-

292

293

`` This special case is deprecated, as the :func:property decorator

``

293

294

` is now correctly identified as abstract when applied to an abstract

`

294

295

` method::

`

`` @@ -322,12 +323,6 @@ The :mod:abc module also provides the following decorators:

``

322

323

` ...

`

323

324

``

324

325

``

325

``

`-

.. deprecated:: 3.3

`

326

``

`` -

It is now possible to use :class:property, :meth:property.getter,

``

327

``

`` -

:meth:property.setter and :meth:property.deleter with

``

328

``

`` -

:func:abstractmethod, making this decorator redundant.

``

329

``

-

330

``

-

331

326

`` The :mod:abc module also provides the following functions:

``

332

327

``

333

328

`.. function:: get_cache_token()

`