Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michiel Cottaar
fslpy
Commits
daea0469
Commit
daea0469
authored
Jan 21, 2018
by
Paul McCarthy
🚵
Browse files
Fix multiple-inheritance object creation issue.
parent
a98bf65c
Changes
3
Hide whitespace changes
Inline
Side-by-side
fsl/data/mesh.py
View file @
daea0469
...
...
@@ -144,6 +144,14 @@ class Mesh(notifier.Notifier, meta.Meta):
"""
def
__new__
(
cls
,
*
args
,
**
kwargs
):
"""Create a ``Mesh``. We must override ``__new__``, otherwise the
:class:`Meta` and :class:`Notifier` ``__new__`` methods will not be
called correctly.
"""
return
super
(
Mesh
,
cls
).
__new__
(
cls
,
*
args
,
**
kwargs
)
def
__init__
(
self
,
indices
,
name
=
'mesh'
,
...
...
fsl/utils/meta.py
View file @
daea0469
...
...
@@ -27,8 +27,13 @@ class Meta(object):
setMeta
"""
def
__init__
(
self
):
self
.
__meta
=
collections
.
OrderedDict
()
def
__new__
(
cls
,
*
args
,
**
kwargs
):
"""Initialises a ``Meta`` instance. """
new
=
super
(
Meta
,
cls
).
__new__
(
cls
)
new
.
__meta
=
collections
.
OrderedDict
()
return
new
def
metaKeys
(
self
):
...
...
fsl/utils/notifier.py
View file @
daea0469
...
...
@@ -94,7 +94,7 @@ class Notifier(object):
instance.
"""
new
=
object
.
__new__
(
cls
)
new
=
super
(
Notifier
,
cls
)
.
__new__
(
cls
)
# Listeners are stored in this
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment