{"action":"opened","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/4586","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/4586/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/4586/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/4586/events","html_url":"https://github.com/astropy/astropy/issues/4586","id":132252608,"number":4586,"title":"A possible bug when creating a wrapper for setter in astropy.modeling.Parameter","user":{"login":"mcara","id":5985250,"avatar_url":"https://avatars.githubusercontent.com/u/5985250?v=3","gravatar_id":"","url":"https://api.github.com/users/mcara","html_url":"https://github.com/mcara","followers_url":"https://api.github.com/users/mcara/followers","following_url":"https://api.github.com/users/mcara/following{/other_user}","gists_url":"https://api.github.com/users/mcara/gists{/gist_id}","starred_url":"https://api.github.com/users/mcara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcara/subscriptions","organizations_url":"https://api.github.com/users/mcara/orgs","repos_url":"https://api.github.com/users/mcara/repos","events_url":"https://api.github.com/users/mcara/events{/privacy}","received_events_url":"https://api.github.com/users/mcara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-08T20:47:38Z","updated_at":"2016-02-08T20:47:38Z","closed_at":null,"body":"I wanted to create a setter with two parameters: value and model. However, initialization of my example model class fails (note: my model is really for testing purposes and is not intended to do anything logical) :\r\n\r\n```python\r\nfrom astropy.modeling import FittableModel, Parameter\r\n\r\ndef mysetter(val,model):\r\n  return val+1\r\n\r\nclass A(FittableModel):\r\n\r\n  outputs = ('z',)\r\n\r\n  xc=Parameter(default=1, setter=mysetter)\r\n  yc=Parameter(default=1)\r\n\r\n  def __init__(self, d, xc, yc):\r\n    self.d=d\r\n    super(FittableModel,self).__init__(xc, yc)\r\n\r\n  def evaluate(self,xc,yc):\r\n    return (xc)**2+(yc)**2+self.d\r\n```\r\nThen\r\n```python\r\n>>> a=A(1,1,2)\r\nTraceback (innermost last):\r\n  File \"<console>\", line 1, in <module>\r\n  File \"<console>\", line 7, in __init__\r\n  File \".../site-packages/astropy/modeling/core.py\", line 683, in __init__\r\n    self._initialize_constraints(kwargs)\r\n  File \".../site-packages/astropy/modeling/core.py\", line 1336, in _initialize_constraints\r\n    param = getattr(self, param_name)\r\n  File \".../site-packages/astropy/modeling/parameters.py\", line 186, in __get__\r\n    parameter._bind(obj)\r\n  File \".../site-packages/astropy/modeling/parameters.py\", line 597, in _bind\r\n    self._setter = self._create_value_wrapper(self._setter, model)\r\n  File \".../site-packages/astropy/modeling/parameters.py\", line 675, in _create_value_wrapper\r\n    model_arg = inputs.args[1].name\r\nAttributeError: 'list' object has no attribute 'args'\r\n```\r\n\r\n@embray Is this a bug or am I doing something wrong?"}}