{"action":"created","comment":{"url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/comments/62868467","id":62868467,"diff_hunk":"@@ -0,0 +1,118 @@\n+# -*- coding: utf-8 -*-\n+import functools\n+import sys\n+\n+\n+def get_fqn(obj):\n+    \"\"\"\n+    This function tries to determine the fully qualified name (FQN) of the callable that is provided.\n+    It only works for classes, methods and functions.\n+    It is unable to properly determine the FQN of class instances, static methods and class methods.\n+    \"\"\"\n+    path = [getattr(obj, '__module__', None)]\n+    if sys.version_info[0] > 2:\n+        qualname = getattr(obj, '__qualname__', None)\n+        if qualname:\n+            path.append(qualname.replace('<locals>.', ''))\n+    else:\n+        im_class = getattr(obj, 'im_class', None)\n+        path.append(getattr(im_class, '__name__', None))\n+        path.append(getattr(obj, '__name__', None))\n+    return '.'.join(filter(None, path))\n+\n+\n+class Decorator(object):\n+    \"\"\"\n+    A base class to easily create decorators.\n+    \"\"\"\n+\n+    def __init__(self, func=None, **params):","path":"decorators/decorators.py","position":29,"original_position":29,"commit_id":"c3acf3e0a911c71b8b055bf36787e8bf707efd4e","original_commit_id":"dff19e8c8766a3fb86b73f8544a0e07ba764b658","user":{"login":"beerdeaap","id":171518,"avatar_url":"https://avatars.githubusercontent.com/u/171518?v=3","gravatar_id":"","url":"https://api.github.com/users/beerdeaap","html_url":"https://github.com/beerdeaap","followers_url":"https://api.github.com/users/beerdeaap/followers","following_url":"https://api.github.com/users/beerdeaap/following{/other_user}","gists_url":"https://api.github.com/users/beerdeaap/gists{/gist_id}","starred_url":"https://api.github.com/users/beerdeaap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beerdeaap/subscriptions","organizations_url":"https://api.github.com/users/beerdeaap/orgs","repos_url":"https://api.github.com/users/beerdeaap/repos","events_url":"https://api.github.com/users/beerdeaap/events{/privacy}","received_events_url":"https://api.github.com/users/beerdeaap/received_events","type":"User","site_admin":false},"body":"What's the use of func being `None` ?","created_at":"2016-05-11T15:21:30Z","updated_at":"2016-05-11T15:21:30Z","html_url":"https://github.com/kpn-digital/py-fqn-decorators/pull/1#discussion_r62868467","pull_request_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/comments/62868467"},"html":{"href":"https://github.com/kpn-digital/py-fqn-decorators/pull/1#discussion_r62868467"},"pull_request":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1","id":69678502,"html_url":"https://github.com/kpn-digital/py-fqn-decorators/pull/1","diff_url":"https://github.com/kpn-digital/py-fqn-decorators/pull/1.diff","patch_url":"https://github.com/kpn-digital/py-fqn-decorators/pull/1.patch","issue_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/1","number":1,"state":"open","locked":false,"title":"NEW fqn decorator class, tests and documentation","user":{"login":"mattiassluis","id":1615459,"avatar_url":"https://avatars.githubusercontent.com/u/1615459?v=3","gravatar_id":"","url":"https://api.github.com/users/mattiassluis","html_url":"https://github.com/mattiassluis","followers_url":"https://api.github.com/users/mattiassluis/followers","following_url":"https://api.github.com/users/mattiassluis/following{/other_user}","gists_url":"https://api.github.com/users/mattiassluis/gists{/gist_id}","starred_url":"https://api.github.com/users/mattiassluis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattiassluis/subscriptions","organizations_url":"https://api.github.com/users/mattiassluis/orgs","repos_url":"https://api.github.com/users/mattiassluis/repos","events_url":"https://api.github.com/users/mattiassluis/events{/privacy}","received_events_url":"https://api.github.com/users/mattiassluis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-11T14:09:18Z","updated_at":"2016-05-11T15:21:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d227dff2481a8065308ee86ce6bceed06eb5935e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1/commits","review_comments_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1/comments","review_comment_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/1/comments","statuses_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/statuses/c3acf3e0a911c71b8b055bf36787e8bf707efd4e","head":{"label":"mattiassluis:master","ref":"master","sha":"c3acf3e0a911c71b8b055bf36787e8bf707efd4e","user":{"login":"mattiassluis","id":1615459,"avatar_url":"https://avatars.githubusercontent.com/u/1615459?v=3","gravatar_id":"","url":"https://api.github.com/users/mattiassluis","html_url":"https://github.com/mattiassluis","followers_url":"https://api.github.com/users/mattiassluis/followers","following_url":"https://api.github.com/users/mattiassluis/following{/other_user}","gists_url":"https://api.github.com/users/mattiassluis/gists{/gist_id}","starred_url":"https://api.github.com/users/mattiassluis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattiassluis/subscriptions","organizations_url":"https://api.github.com/users/mattiassluis/orgs","repos_url":"https://api.github.com/users/mattiassluis/repos","events_url":"https://api.github.com/users/mattiassluis/events{/privacy}","received_events_url":"https://api.github.com/users/mattiassluis/received_events","type":"User","site_admin":false},"repo":{"id":58550146,"name":"py-fqn-decorators","full_name":"mattiassluis/py-fqn-decorators","owner":{"login":"mattiassluis","id":1615459,"avatar_url":"https://avatars.githubusercontent.com/u/1615459?v=3","gravatar_id":"","url":"https://api.github.com/users/mattiassluis","html_url":"https://github.com/mattiassluis","followers_url":"https://api.github.com/users/mattiassluis/followers","following_url":"https://api.github.com/users/mattiassluis/following{/other_user}","gists_url":"https://api.github.com/users/mattiassluis/gists{/gist_id}","starred_url":"https://api.github.com/users/mattiassluis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattiassluis/subscriptions","organizations_url":"https://api.github.com/users/mattiassluis/orgs","repos_url":"https://api.github.com/users/mattiassluis/repos","events_url":"https://api.github.com/users/mattiassluis/events{/privacy}","received_events_url":"https://api.github.com/users/mattiassluis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattiassluis/py-fqn-decorators","description":"","fork":true,"url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators","forks_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/forks","keys_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/teams","hooks_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/hooks","issue_events_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/issues/events{/number}","events_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/events","assignees_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/assignees{/user}","branches_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/branches{/branch}","tags_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/tags","blobs_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/statuses/{sha}","languages_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/languages","stargazers_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/stargazers","contributors_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/contributors","subscribers_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/subscribers","subscription_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/subscription","commits_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/contents/{+path}","compare_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/merges","archive_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/downloads","issues_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/issues{/number}","pulls_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/pulls{/number}","milestones_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/milestones{/number}","notifications_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/labels{/name}","releases_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/releases{/id}","deployments_url":"https://api.github.com/repos/mattiassluis/py-fqn-decorators/deployments","created_at":"2016-05-11T14:02:38Z","updated_at":"2016-05-11T14:06:57Z","pushed_at":"2016-05-11T14:36:48Z","git_url":"git://github.com/mattiassluis/py-fqn-decorators.git","ssh_url":"git@github.com:mattiassluis/py-fqn-decorators.git","clone_url":"https://github.com/mattiassluis/py-fqn-decorators.git","svn_url":"https://github.com/mattiassluis/py-fqn-decorators","homepage":null,"size":2395,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kpn-digital:master","ref":"master","sha":"c17227711c0c14d2cd249619631ad3d6400a7a43","user":{"login":"kpn-digital","id":16085467,"avatar_url":"https://avatars.githubusercontent.com/u/16085467?v=3","gravatar_id":"","url":"https://api.github.com/users/kpn-digital","html_url":"https://github.com/kpn-digital","followers_url":"https://api.github.com/users/kpn-digital/followers","following_url":"https://api.github.com/users/kpn-digital/following{/other_user}","gists_url":"https://api.github.com/users/kpn-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/kpn-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpn-digital/subscriptions","organizations_url":"https://api.github.com/users/kpn-digital/orgs","repos_url":"https://api.github.com/users/kpn-digital/repos","events_url":"https://api.github.com/users/kpn-digital/events{/privacy}","received_events_url":"https://api.github.com/users/kpn-digital/received_events","type":"Organization","site_admin":false},"repo":{"id":58539894,"name":"py-fqn-decorators","full_name":"kpn-digital/py-fqn-decorators","owner":{"login":"kpn-digital","id":16085467,"avatar_url":"https://avatars.githubusercontent.com/u/16085467?v=3","gravatar_id":"","url":"https://api.github.com/users/kpn-digital","html_url":"https://github.com/kpn-digital","followers_url":"https://api.github.com/users/kpn-digital/followers","following_url":"https://api.github.com/users/kpn-digital/following{/other_user}","gists_url":"https://api.github.com/users/kpn-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/kpn-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpn-digital/subscriptions","organizations_url":"https://api.github.com/users/kpn-digital/orgs","repos_url":"https://api.github.com/users/kpn-digital/repos","events_url":"https://api.github.com/users/kpn-digital/events{/privacy}","received_events_url":"https://api.github.com/users/kpn-digital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kpn-digital/py-fqn-decorators","description":"","fork":false,"url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators","forks_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/forks","keys_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/teams","hooks_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/hooks","issue_events_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/events{/number}","events_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/events","assignees_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/assignees{/user}","branches_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/branches{/branch}","tags_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/tags","blobs_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/git/refs{/sha}","trees_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/statuses/{sha}","languages_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/languages","stargazers_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/stargazers","contributors_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/contributors","subscribers_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/subscribers","subscription_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/subscription","commits_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/commits{/sha}","git_commits_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/git/commits{/sha}","comments_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/comments{/number}","issue_comment_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/comments{/number}","contents_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/contents/{+path}","compare_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/merges","archive_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/downloads","issues_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues{/number}","pulls_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls{/number}","milestones_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/milestones{/number}","notifications_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/labels{/name}","releases_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/releases{/id}","deployments_url":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/deployments","created_at":"2016-05-11T11:40:45Z","updated_at":"2016-05-11T11:40:45Z","pushed_at":"2016-05-11T14:36:49Z","git_url":"git://github.com/kpn-digital/py-fqn-decorators.git","ssh_url":"git@github.com:kpn-digital/py-fqn-decorators.git","clone_url":"https://github.com/kpn-digital/py-fqn-decorators.git","svn_url":"https://github.com/kpn-digital/py-fqn-decorators","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1"},"html":{"href":"https://github.com/kpn-digital/py-fqn-decorators/pull/1"},"issue":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/1"},"comments":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/kpn-digital/py-fqn-decorators/statuses/c3acf3e0a911c71b8b055bf36787e8bf707efd4e"}}}}