{"action":"created","issue":{"url":"https://api.github.com/repos/pvcraven/arcade/issues/208","repository_url":"https://api.github.com/repos/pvcraven/arcade","labels_url":"https://api.github.com/repos/pvcraven/arcade/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/pvcraven/arcade/issues/208/comments","events_url":"https://api.github.com/repos/pvcraven/arcade/issues/208/events","html_url":"https://github.com/pvcraven/arcade/issues/208","id":323789204,"number":208,"title":"Sprite Class set_position Method Declared Twice","user":{"login":"jgrantdev","id":33164011,"avatar_url":"https://avatars2.githubusercontent.com/u/33164011?v=4","gravatar_id":"","url":"https://api.github.com/users/jgrantdev","html_url":"https://github.com/jgrantdev","followers_url":"https://api.github.com/users/jgrantdev/followers","following_url":"https://api.github.com/users/jgrantdev/following{/other_user}","gists_url":"https://api.github.com/users/jgrantdev/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrantdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrantdev/subscriptions","organizations_url":"https://api.github.com/users/jgrantdev/orgs","repos_url":"https://api.github.com/users/jgrantdev/repos","events_url":"https://api.github.com/users/jgrantdev/events{/privacy}","received_events_url":"https://api.github.com/users/jgrantdev/received_events","type":"User","site_admin":false},"labels":[{"id":306725622,"url":"https://api.github.com/repos/pvcraven/arcade/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-16T21:14:12Z","updated_at":"2018-05-17T20:34:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The `set_position()` method of the `Sprite` class is declared twice with different signatures. \r\n\r\nhttps://github.com/pvcraven/arcade/blob/d5e51add5270aea66d9ca7d37c4a445cf64f9ce6/arcade/sprite.py#L227\r\n\r\nhttps://github.com/pvcraven/arcade/blob/d5e51add5270aea66d9ca7d37c4a445cf64f9ce6/arcade/sprite.py#L302\r\n\r\nIf you read the documentation [here](http://arcade.academy/_modules/arcade/sprite.html) you would expect this to work:\r\n```\r\nmy_sprite = arcade.Sprite()\r\nmy_sprite.set_position(10, 10)\r\n```\r\nHowever it results in\r\n```\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nTypeError: set_position() takes 2 positional arguments but 3 were given\r\n```\r\n\r\nThe examples all work because they are directly changing `my_sprite.center_x` and `my_sprite.center_y` instead of using `set_position()`.\r\n\r\nOne implementation is modifying the member variables `center_x` and `center_y`. The other implementation is modifying the member list `_position`.\r\n\r\nThe `draw()` method is passing `center_x` and `center_y` to `draw_texture_rectangle()` so right now the only `set_position()` that would work is the one that is not accessible.\r\n\r\nThe following methods are all accessing `_position`\r\n```\r\n_get_center_x\r\n_get_center_y\r\n_set_center_x\r\n_set_center_y\r\nget_position\r\nset_position\r\n```\r\n\r\nIs this a problem with trying to do the same thing two different ways or was center_x and center_y intended to be used to change the origin for the sprite?\r\n\r\nThe main documentation hides the first implementation of `set_position()`, but when you go to the view source part of the documentation I linked it is there.\r\n\r\nI can fix this and update the examples, I am just unsure of what is intended."},"comment":{"url":"https://api.github.com/repos/pvcraven/arcade/issues/comments/390002210","html_url":"https://github.com/pvcraven/arcade/issues/208#issuecomment-390002210","issue_url":"https://api.github.com/repos/pvcraven/arcade/issues/208","id":390002210,"user":{"login":"jgrantdev","id":33164011,"avatar_url":"https://avatars2.githubusercontent.com/u/33164011?v=4","gravatar_id":"","url":"https://api.github.com/users/jgrantdev","html_url":"https://github.com/jgrantdev","followers_url":"https://api.github.com/users/jgrantdev/followers","following_url":"https://api.github.com/users/jgrantdev/following{/other_user}","gists_url":"https://api.github.com/users/jgrantdev/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrantdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrantdev/subscriptions","organizations_url":"https://api.github.com/users/jgrantdev/orgs","repos_url":"https://api.github.com/users/jgrantdev/repos","events_url":"https://api.github.com/users/jgrantdev/events{/privacy}","received_events_url":"https://api.github.com/users/jgrantdev/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T20:34:38Z","updated_at":"2018-05-17T20:34:38Z","author_association":"CONTRIBUTOR","body":"@pvcraven I am confused about going with the former definition, but removing the first operation.\r\n\r\nRemoving `def set_position(self, new_position: (float, float)): ` makes the most sense to me."}}
{"actor":{"display_login":"jgrantdev"}}