{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/18345","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/18345/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/18345/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/18345/events","html_url":"https://github.com/godotengine/godot/issues/18345","id":316539341,"number":18345,"title":"GDScript suggestion: The \"With\" Construction from GMS","user":{"login":"NoodleSushi","id":34954180,"avatar_url":"https://avatars0.githubusercontent.com/u/34954180?v=4","gravatar_id":"","url":"https://api.github.com/users/NoodleSushi","html_url":"https://github.com/NoodleSushi","followers_url":"https://api.github.com/users/NoodleSushi/followers","following_url":"https://api.github.com/users/NoodleSushi/following{/other_user}","gists_url":"https://api.github.com/users/NoodleSushi/gists{/gist_id}","starred_url":"https://api.github.com/users/NoodleSushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoodleSushi/subscriptions","organizations_url":"https://api.github.com/users/NoodleSushi/orgs","repos_url":"https://api.github.com/users/NoodleSushi/repos","events_url":"https://api.github.com/users/NoodleSushi/events{/privacy}","received_events_url":"https://api.github.com/users/NoodleSushi/received_events","type":"User","site_admin":false},"labels":[{"id":73330068,"url":"https://api.github.com/repos/godotengine/godot/labels/feature%20proposal","name":"feature proposal","color":"1144ff","default":false},{"id":279098082,"url":"https://api.github.com/repos/godotengine/godot/labels/topic:gdscript","name":"topic:gdscript","color":"ffdd44","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-22T01:11:01Z","updated_at":"2018-04-24T20:56:52Z","closed_at":null,"author_association":"NONE","body":"It executes the given statement to a given node with the \"other\" keyword, for example:\r\n```gdscript\r\nextends Node2D\r\nvar random_color = Color()\r\nvar random_position = Vector2()\r\n\r\nfunc _process(dt):\r\n   var window_size = OS.get_window_size()\r\n   #set random color\r\n   random_color = Color(randf(),randf(),randf())\r\n   random_position = Vector2(rand_range(window_size.x),rand_range(window_size.y))\r\n   #The expression/node is a Polygon2D ($rectangle)\r\n   with ($rectangle):\r\n      set_color(other.random_color)\r\n      set_position(other.random_position)\r\n```"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/384077322","html_url":"https://github.com/godotengine/godot/issues/18345#issuecomment-384077322","issue_url":"https://api.github.com/repos/godotengine/godot/issues/18345","id":384077322,"user":{"login":"raymoo","id":5734399,"avatar_url":"https://avatars3.githubusercontent.com/u/5734399?v=4","gravatar_id":"","url":"https://api.github.com/users/raymoo","html_url":"https://github.com/raymoo","followers_url":"https://api.github.com/users/raymoo/followers","following_url":"https://api.github.com/users/raymoo/following{/other_user}","gists_url":"https://api.github.com/users/raymoo/gists{/gist_id}","starred_url":"https://api.github.com/users/raymoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymoo/subscriptions","organizations_url":"https://api.github.com/users/raymoo/orgs","repos_url":"https://api.github.com/users/raymoo/repos","events_url":"https://api.github.com/users/raymoo/events{/privacy}","received_events_url":"https://api.github.com/users/raymoo/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T20:56:52Z","updated_at":"2018-04-24T20:56:52Z","author_association":"CONTRIBUTOR","body":"@nobuyukinyuu `with` statements in Python let you initialize something that needs cleanup and it will automatically run the cleanup if there is an exception within the with statement body (or if the body exits normally). It's like RAII in C++ for variables on the stack."}}
{"actor":{"display_login":"raymoo"}}