Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10 quick fixup #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions eventdispatcher/dictproperty.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__author__ = 'calvin'
import collections
import collections.abc
from future.utils import iteritems, iterkeys, itervalues
from functools import partial
from . import Property
Expand All @@ -10,7 +11,7 @@ class __DoesNotExist__:
pass


class ObservableDict(collections.MutableMapping):
class ObservableDict(collections.abc.MutableMapping):

def __init__(self, dictionary, dispatch_method):
self.dictionary = dictionary.copy()
Expand Down Expand Up @@ -143,4 +144,4 @@ def __set__(self, obj, value):
p['value'].dictionary.update(value) # Assign to the ObservableDict's value
for callback in p['callbacks']:
if callback(obj, value):
break
break
3 changes: 2 additions & 1 deletion eventdispatcher/listproperty.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
__author__ = 'calvin'

import collections
import collections.abc
from functools import partial
from copy import copy
import numpy as np

from . import Property


class ObservableList(collections.MutableSequence):
class ObservableList(collections.abc.MutableSequence):
def __init__(self, l, dispatch_method, dtype=None):
if not type(l) == list and not type(l) == tuple and not isinstance(l, ObservableList):
raise ValueError('Observable list must only be initialized with sequences as arguments')
Expand Down
5 changes: 3 additions & 2 deletions eventdispatcher/setproperty.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
__author__ = 'calvin'
import collections
import collections.abc
from functools import partial
from . import Property


class ObservableSet(collections.MutableSet):
class ObservableSet(collections.abc.MutableSet):

def __init__(self, dictionary, dispatch_method):
self.set = dictionary.copy()
Expand Down Expand Up @@ -110,4 +111,4 @@ def __set__(self, obj, value):
if do_dispatch:
for callback in p['callbacks']:
if callback(obj, value):
break
break