{"action":"created","issue":{"url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/3","repository_url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io","labels_url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/3/comments","events_url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/3/events","html_url":"https://github.com/ShawnNew/ShawnNew.github.io/issues/3","id":310201902,"number":3,"title":"Python中self是什么？类和对象的关系","user":{"login":"ShawnNew","id":21559339,"avatar_url":"https://avatars1.githubusercontent.com/u/21559339?v=4","gravatar_id":"","url":"https://api.github.com/users/ShawnNew","html_url":"https://github.com/ShawnNew","followers_url":"https://api.github.com/users/ShawnNew/followers","following_url":"https://api.github.com/users/ShawnNew/following{/other_user}","gists_url":"https://api.github.com/users/ShawnNew/gists{/gist_id}","starred_url":"https://api.github.com/users/ShawnNew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShawnNew/subscriptions","organizations_url":"https://api.github.com/users/ShawnNew/orgs","repos_url":"https://api.github.com/users/ShawnNew/repos","events_url":"https://api.github.com/users/ShawnNew/events{/privacy}","received_events_url":"https://api.github.com/users/ShawnNew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-31T01:28:36Z","updated_at":"2018-04-07T02:29:34Z","closed_at":null,"author_association":"OWNER","body":""},"comment":{"url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/comments/379426073","html_url":"https://github.com/ShawnNew/ShawnNew.github.io/issues/3#issuecomment-379426073","issue_url":"https://api.github.com/repos/ShawnNew/ShawnNew.github.io/issues/3","id":379426073,"user":{"login":"Seanforfun","id":32276204,"avatar_url":"https://avatars3.githubusercontent.com/u/32276204?v=4","gravatar_id":"","url":"https://api.github.com/users/Seanforfun","html_url":"https://github.com/Seanforfun","followers_url":"https://api.github.com/users/Seanforfun/followers","following_url":"https://api.github.com/users/Seanforfun/following{/other_user}","gists_url":"https://api.github.com/users/Seanforfun/gists{/gist_id}","starred_url":"https://api.github.com/users/Seanforfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seanforfun/subscriptions","organizations_url":"https://api.github.com/users/Seanforfun/orgs","repos_url":"https://api.github.com/users/Seanforfun/repos","events_url":"https://api.github.com/users/Seanforfun/events{/privacy}","received_events_url":"https://api.github.com/users/Seanforfun/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T02:29:34Z","updated_at":"2018-04-07T02:29:34Z","author_association":"NONE","body":"看到这个问题想要讨论一下\r\n我对python不是很了解，一直把self当做是java中的this在用。感觉this是一个引用，是对当前类所生成的对象的实例的引用，如果类比于C语言，我认为this是一个指针，用于指向当前实例在堆中的首地址，通过这个指针我们可以对当前实例中的（所有）属性和方法进行访问。这些都是java中的一些想法，不知道python中的self是否也是这样。\r\n在java中，我认为类是由程序员定义存储内容，由JVM在解析.class文件时分配在内存(没有具体查阅资料，不知道是不是就是stack)上的一块“方法区”，同时JVM会在heap中生成一份对应的Class对象，用于反射。宏观上说，我认为类是一个声明。\r\n对象在面向对象编程中有多个含义，不讨论抽象的面向对象，我认为对象是一个实例，是将类在方法区中定义的抽象内容的具体化的实例。对象可以用来存储信息，发送信息和接受信息，是构成面向对象编程的基本运行单元。\r\n"}}
{"actor":{"display_login":"Seanforfun"}}