Skip to content

Commit

Permalink
Always warn for deprecated call (#3499)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens authored and philippjfr committed Sep 22, 2019
1 parent 5c4bf7b commit bdc26eb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions holoviews/core/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,19 +1229,17 @@ def __str__(self):
def __unicode__(self):
return unicode(PrettyPrinter.pprint(self))

def __call__(self, options=None, **kwargs):
if util.config.warn_options_call:
self.param.warning(
'Use of __call__ to set options will be deprecated '
'in future. Use the equivalent opts method or use '
'the recommended .options method instead.')

if not kwargs and options is None:
def __call__(self, options=None, **kwargs):
self.param.warning(
'Use of __call__ to set options will be deprecated '
'in the next major release (1.14.0). Use the equivalent .opts '
'method instead.')

if not kwargs and options is None:
return self.opts.clear()

return self.opts(options, **kwargs)


def options(self, *args, **kwargs):
"""Applies simplified option definition returning a new object.
Expand Down

0 comments on commit bdc26eb

Please sign in to comment.