Skip to content

Commit

Permalink
Add weakref support for Symbols, fix sympy/sympy#8825
Browse files Browse the repository at this point in the history
At this commit::

    $ ./bin/isympy -q
    Python console for SymPy 0.7.6-git (Python 2.7.3-64-bit) (ground types: python)

    >>> import weakref
    >>> d = weakref.WeakKeyDictionary([(x,1), (y, 2)])
    >>> print(d.items())
    [(x, 1), (y, 2)]
    >>> del x
    >>> print(d.items())
    [(y, 2)]
  • Loading branch information
skirpichev committed May 2, 2015
1 parent 511090a commit 32704bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sympy/core/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Symbol(AtomicExpr, Boolean):

is_comparable = False

__slots__ = ['name']
__slots__ = ['name', '__weakref__']

is_Symbol = True

Expand Down

0 comments on commit 32704bf

Please sign in to comment.