On this page
  1. weakref.ProxyType
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

weakref.ProxyType

Prev: weakref.proxy | Up: weakref | Next: weakref.ref
Rel: weakref.CallableProxyType, weakref.finalize, weakref.getweakrefcount, weakref.getweakrefs
Ref: docs.python.org — weakref.ProxyType
Tags: #public #python3 #stdlib #weakref


Import

import weakref
from weakref import ProxyType

Signature & Overview

weakref.ProxyType()

weakref.ProxyType class.

Usage

import weakref

class Box:
    def __init__(self, x): self.x = x

b = Box(7)
p = weakref.proxy(b)
assert isinstance(p, weakref.ProxyType) and p.x == 7

Gotchas

REPL Inspect

from weakref import ProxyType
help(ProxyType)

Linked from

Related notes