|
17 | 17 |
|
18 | 18 | from odl.set import Field, LinearSpace, Set
|
19 | 19 | from odl.set.space import LinearSpaceElement
|
20 |
| -from odl.util import cache_arguments |
21 | 20 |
|
22 | 21 | __all__ = (
|
23 | 22 | 'Operator',
|
@@ -122,7 +121,6 @@ def _function_signature(func):
|
122 | 121 | return '{}({})'.format(func.__name__, argstr)
|
123 | 122 |
|
124 | 123 |
|
125 |
| -@cache_arguments |
126 | 124 | def _dispatch_call_args(cls=None, bound_call=None, unbound_call=None,
|
127 | 125 | attr='_call'):
|
128 | 126 | """Check the arguments of ``_call()`` or similar for conformity.
|
@@ -420,20 +418,21 @@ class described in the following.
|
420 | 418 |
|
421 | 419 | def __new__(cls, *args, **kwargs):
|
422 | 420 | """Create a new instance."""
|
423 |
| - call_has_out, call_out_optional, _ = _dispatch_call_args(cls) |
424 |
| - cls._call_has_out = call_has_out |
425 |
| - cls._call_out_optional = call_out_optional |
426 |
| - if not call_has_out: |
427 |
| - # Out-of-place _call |
428 |
| - cls._call_in_place = _default_call_in_place |
429 |
| - cls._call_out_of_place = cls._call |
430 |
| - elif call_out_optional: |
431 |
| - # Dual-use _call |
432 |
| - cls._call_in_place = cls._call_out_of_place = cls._call |
433 |
| - else: |
434 |
| - # In-place-only _call |
435 |
| - cls._call_in_place = cls._call |
436 |
| - cls._call_out_of_place = _default_call_out_of_place |
| 421 | + if '_call_out_of_place' not in cls.__dict__: |
| 422 | + call_has_out, call_out_optional, _ = _dispatch_call_args(cls) |
| 423 | + cls._call_has_out = call_has_out |
| 424 | + cls._call_out_optional = call_out_optional |
| 425 | + if not call_has_out: |
| 426 | + # Out-of-place _call |
| 427 | + cls._call_in_place = _default_call_in_place |
| 428 | + cls._call_out_of_place = cls._call |
| 429 | + elif call_out_optional: |
| 430 | + # Dual-use _call |
| 431 | + cls._call_in_place = cls._call_out_of_place = cls._call |
| 432 | + else: |
| 433 | + # In-place-only _call |
| 434 | + cls._call_in_place = cls._call |
| 435 | + cls._call_out_of_place = _default_call_out_of_place |
437 | 436 |
|
438 | 437 | return object.__new__(cls)
|
439 | 438 |
|
|
0 commit comments