{"action":"closed","number":3736,"pull_request":{"url":"https://api.github.com/repos/kivy/kivy/pulls/3736","id":49237114,"html_url":"https://github.com/kivy/kivy/pull/3736","diff_url":"https://github.com/kivy/kivy/pull/3736.diff","patch_url":"https://github.com/kivy/kivy/pull/3736.patch","issue_url":"https://api.github.com/repos/kivy/kivy/issues/3736","number":3736,"state":"closed","locked":false,"title":"Make widget kwargs passing higher priority than kv","user":{"login":"matham","id":1644286,"avatar_url":"https://avatars.githubusercontent.com/u/1644286?v=3","gravatar_id":"","url":"https://api.github.com/users/matham","html_url":"https://github.com/matham","followers_url":"https://api.github.com/users/matham/followers","following_url":"https://api.github.com/users/matham/following{/other_user}","gists_url":"https://api.github.com/users/matham/gists{/gist_id}","starred_url":"https://api.github.com/users/matham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matham/subscriptions","organizations_url":"https://api.github.com/users/matham/orgs","repos_url":"https://api.github.com/users/matham/repos","events_url":"https://api.github.com/users/matham/events{/privacy}","received_events_url":"https://api.github.com/users/matham/received_events","type":"User","site_admin":false},"body":"Fixes #3118.\r\n\r\nThis is one solution to that issue. I think ideally if the kv rule has rule bindings than kv has higher priority since it'd be overwritten later anyway. But if the rule is a constant (e.g. `val: 55`) or the rule is not a bindable rule (e.g. `val: self.attr`, where `self.attr` is not a kivy property) then I think kv should have lower priority (i.e. `Widget(val=val)` has higher precedence).\r\n\r\nThis implements it, although in a bit of a hacky way. But it's the best I could come up with given the problem.\r\n\r\nExample code:\r\n```py\r\nfrom kivy.lang import Builder\r\nfrom kivy.uix.button import Button\r\n\r\nBuilder.load_string('''\r\n<Button>:\r\n    text: 'bad'\r\n    height: 55\r\n    width: name.width + 55\r\n    x: (name.swamp + 55) if None else 55\r\n    Widget:\r\n        id: name\r\n''')\r\n\r\nb = Button(text='good', height=123, width=123, x=123)\r\nprint b.text, b.height, b.width, b.x\r\n```\r\nbefore prints `bad 55 155 55`.\r\nafter prints `good 123 155 123`.","created_at":"2015-10-30T06:53:44Z","updated_at":"2015-11-20T20:58:14Z","closed_at":"2015-11-20T20:58:13Z","merged_at":"2015-11-20T20:58:13Z","merge_commit_sha":"81d93876cfd62302aebcc487342dcd50a86a5508","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kivy/kivy/pulls/3736/commits","review_comments_url":"https://api.github.com/repos/kivy/kivy/pulls/3736/comments","review_comment_url":"https://api.github.com/repos/kivy/kivy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kivy/kivy/issues/3736/comments","statuses_url":"https://api.github.com/repos/kivy/kivy/statuses/ceabaf49d61fbfb065edd5b173c3bc3eb854a35c","head":{"label":"matham:kv-overwrite","ref":"kv-overwrite","sha":"ceabaf49d61fbfb065edd5b173c3bc3eb854a35c","user":{"login":"matham","id":1644286,"avatar_url":"https://avatars.githubusercontent.com/u/1644286?v=3","gravatar_id":"","url":"https://api.github.com/users/matham","html_url":"https://github.com/matham","followers_url":"https://api.github.com/users/matham/followers","following_url":"https://api.github.com/users/matham/following{/other_user}","gists_url":"https://api.github.com/users/matham/gists{/gist_id}","starred_url":"https://api.github.com/users/matham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matham/subscriptions","organizations_url":"https://api.github.com/users/matham/orgs","repos_url":"https://api.github.com/users/matham/repos","events_url":"https://api.github.com/users/matham/events{/privacy}","received_events_url":"https://api.github.com/users/matham/received_events","type":"User","site_admin":false},"repo":{"id":8808295,"name":"kivy","full_name":"matham/kivy","owner":{"login":"matham","id":1644286,"avatar_url":"https://avatars.githubusercontent.com/u/1644286?v=3","gravatar_id":"","url":"https://api.github.com/users/matham","html_url":"https://github.com/matham","followers_url":"https://api.github.com/users/matham/followers","following_url":"https://api.github.com/users/matham/following{/other_user}","gists_url":"https://api.github.com/users/matham/gists{/gist_id}","starred_url":"https://api.github.com/users/matham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matham/subscriptions","organizations_url":"https://api.github.com/users/matham/orgs","repos_url":"https://api.github.com/users/matham/repos","events_url":"https://api.github.com/users/matham/events{/privacy}","received_events_url":"https://api.github.com/users/matham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matham/kivy","description":"Open source software library for creating NUI applications, running on Windows, Linux, MacOSX, Android","fork":true,"url":"https://api.github.com/repos/matham/kivy","forks_url":"https://api.github.com/repos/matham/kivy/forks","keys_url":"https://api.github.com/repos/matham/kivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matham/kivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matham/kivy/teams","hooks_url":"https://api.github.com/repos/matham/kivy/hooks","issue_events_url":"https://api.github.com/repos/matham/kivy/issues/events{/number}","events_url":"https://api.github.com/repos/matham/kivy/events","assignees_url":"https://api.github.com/repos/matham/kivy/assignees{/user}","branches_url":"https://api.github.com/repos/matham/kivy/branches{/branch}","tags_url":"https://api.github.com/repos/matham/kivy/tags","blobs_url":"https://api.github.com/repos/matham/kivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matham/kivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matham/kivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/matham/kivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matham/kivy/statuses/{sha}","languages_url":"https://api.github.com/repos/matham/kivy/languages","stargazers_url":"https://api.github.com/repos/matham/kivy/stargazers","contributors_url":"https://api.github.com/repos/matham/kivy/contributors","subscribers_url":"https://api.github.com/repos/matham/kivy/subscribers","subscription_url":"https://api.github.com/repos/matham/kivy/subscription","commits_url":"https://api.github.com/repos/matham/kivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/matham/kivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/matham/kivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/matham/kivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/matham/kivy/contents/{+path}","compare_url":"https://api.github.com/repos/matham/kivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matham/kivy/merges","archive_url":"https://api.github.com/repos/matham/kivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matham/kivy/downloads","issues_url":"https://api.github.com/repos/matham/kivy/issues{/number}","pulls_url":"https://api.github.com/repos/matham/kivy/pulls{/number}","milestones_url":"https://api.github.com/repos/matham/kivy/milestones{/number}","notifications_url":"https://api.github.com/repos/matham/kivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matham/kivy/labels{/name}","releases_url":"https://api.github.com/repos/matham/kivy/releases{/id}","created_at":"2013-03-15T20:25:25Z","updated_at":"2015-04-26T22:51:44Z","pushed_at":"2015-11-20T10:55:26Z","git_url":"git://github.com/matham/kivy.git","ssh_url":"git@github.com:matham/kivy.git","clone_url":"https://github.com/matham/kivy.git","svn_url":"https://github.com/matham/kivy","homepage":"http://kivy.org/","size":46834,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kivy:master","ref":"master","sha":"296d71f7f0894b7f10c5118b404455f48492b3c0","user":{"login":"kivy","id":1266152,"avatar_url":"https://avatars.githubusercontent.com/u/1266152?v=3","gravatar_id":"","url":"https://api.github.com/users/kivy","html_url":"https://github.com/kivy","followers_url":"https://api.github.com/users/kivy/followers","following_url":"https://api.github.com/users/kivy/following{/other_user}","gists_url":"https://api.github.com/users/kivy/gists{/gist_id}","starred_url":"https://api.github.com/users/kivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivy/subscriptions","organizations_url":"https://api.github.com/users/kivy/orgs","repos_url":"https://api.github.com/users/kivy/repos","events_url":"https://api.github.com/users/kivy/events{/privacy}","received_events_url":"https://api.github.com/users/kivy/received_events","type":"Organization","site_admin":false},"repo":{"id":1049095,"name":"kivy","full_name":"kivy/kivy","owner":{"login":"kivy","id":1266152,"avatar_url":"https://avatars.githubusercontent.com/u/1266152?v=3","gravatar_id":"","url":"https://api.github.com/users/kivy","html_url":"https://github.com/kivy","followers_url":"https://api.github.com/users/kivy/followers","following_url":"https://api.github.com/users/kivy/following{/other_user}","gists_url":"https://api.github.com/users/kivy/gists{/gist_id}","starred_url":"https://api.github.com/users/kivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivy/subscriptions","organizations_url":"https://api.github.com/users/kivy/orgs","repos_url":"https://api.github.com/users/kivy/repos","events_url":"https://api.github.com/users/kivy/events{/privacy}","received_events_url":"https://api.github.com/users/kivy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kivy/kivy","description":"Open source Python framework for creating NUI applications, running on Windows, Linux, OS X, Android and iOS","fork":false,"url":"https://api.github.com/repos/kivy/kivy","forks_url":"https://api.github.com/repos/kivy/kivy/forks","keys_url":"https://api.github.com/repos/kivy/kivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kivy/kivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kivy/kivy/teams","hooks_url":"https://api.github.com/repos/kivy/kivy/hooks","issue_events_url":"https://api.github.com/repos/kivy/kivy/issues/events{/number}","events_url":"https://api.github.com/repos/kivy/kivy/events","assignees_url":"https://api.github.com/repos/kivy/kivy/assignees{/user}","branches_url":"https://api.github.com/repos/kivy/kivy/branches{/branch}","tags_url":"https://api.github.com/repos/kivy/kivy/tags","blobs_url":"https://api.github.com/repos/kivy/kivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kivy/kivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kivy/kivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kivy/kivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kivy/kivy/statuses/{sha}","languages_url":"https://api.github.com/repos/kivy/kivy/languages","stargazers_url":"https://api.github.com/repos/kivy/kivy/stargazers","contributors_url":"https://api.github.com/repos/kivy/kivy/contributors","subscribers_url":"https://api.github.com/repos/kivy/kivy/subscribers","subscription_url":"https://api.github.com/repos/kivy/kivy/subscription","commits_url":"https://api.github.com/repos/kivy/kivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kivy/kivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kivy/kivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kivy/kivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kivy/kivy/contents/{+path}","compare_url":"https://api.github.com/repos/kivy/kivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kivy/kivy/merges","archive_url":"https://api.github.com/repos/kivy/kivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kivy/kivy/downloads","issues_url":"https://api.github.com/repos/kivy/kivy/issues{/number}","pulls_url":"https://api.github.com/repos/kivy/kivy/pulls{/number}","milestones_url":"https://api.github.com/repos/kivy/kivy/milestones{/number}","notifications_url":"https://api.github.com/repos/kivy/kivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kivy/kivy/labels{/name}","releases_url":"https://api.github.com/repos/kivy/kivy/releases{/id}","created_at":"2010-11-03T20:27:32Z","updated_at":"2015-11-20T18:49:59Z","pushed_at":"2015-11-20T20:58:13Z","git_url":"git://github.com/kivy/kivy.git","ssh_url":"git@github.com:kivy/kivy.git","clone_url":"https://github.com/kivy/kivy.git","svn_url":"https://github.com/kivy/kivy","homepage":"http://kivy.org","size":140240,"stargazers_count":3703,"watchers_count":3703,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":943,"mirror_url":null,"open_issues_count":470,"forks":943,"open_issues":470,"watchers":3703,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kivy/kivy/pulls/3736"},"html":{"href":"https://github.com/kivy/kivy/pull/3736"},"issue":{"href":"https://api.github.com/repos/kivy/kivy/issues/3736"},"comments":{"href":"https://api.github.com/repos/kivy/kivy/issues/3736/comments"},"review_comments":{"href":"https://api.github.com/repos/kivy/kivy/pulls/3736/comments"},"review_comment":{"href":"https://api.github.com/repos/kivy/kivy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kivy/kivy/pulls/3736/commits"},"statuses":{"href":"https://api.github.com/repos/kivy/kivy/statuses/ceabaf49d61fbfb065edd5b173c3bc3eb854a35c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"akshayaurora","id":788023,"avatar_url":"https://avatars.githubusercontent.com/u/788023?v=3","gravatar_id":"","url":"https://api.github.com/users/akshayaurora","html_url":"https://github.com/akshayaurora","followers_url":"https://api.github.com/users/akshayaurora/followers","following_url":"https://api.github.com/users/akshayaurora/following{/other_user}","gists_url":"https://api.github.com/users/akshayaurora/gists{/gist_id}","starred_url":"https://api.github.com/users/akshayaurora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akshayaurora/subscriptions","organizations_url":"https://api.github.com/users/akshayaurora/orgs","repos_url":"https://api.github.com/users/akshayaurora/repos","events_url":"https://api.github.com/users/akshayaurora/events{/privacy}","received_events_url":"https://api.github.com/users/akshayaurora/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":4,"additions":94,"deletions":20,"changed_files":5}}