Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:not': 0.03; 'subject:Why': 0.09; 'def': 0.12; 'display_name': 0.16; 'process?': 0.16; 'subject:class': 0.16; '>>>': 0.22; 'header :User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'class': 0.32; 'skip:_ 10': 0.34; 'subject:the': 0.34; 'received:google.com': 0.35; 'subject:?': 0.36; 'received:10': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'called': 0.40; 'how': 0.40; 'telling': 0.64; 'to:addr:gmail.com': 0.65; 'contact': 0.67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=RdrauwCffGZMraT+8+qx1LxBb9SIcYQkRDBqvWP4ouc=; b=D7nRUV9f1W3gklrIn2YTrkIjK9WLpsKbOUr2+UxGzmIhywkt7WwmVSaSAYSR16FviX avQXHpXkO8nqh2jZ2Zz7Hlvevvl96Zi/oOqmINZDzHKY9bu3IlwcXoie8ndm4270oPuI /Tyb9oEbMnaZG3ihXRHJyZ6OGESfDAHm4fXZaWtjxejZZQw/H1smWiKC/9IouB7RpBgl 5lvutpZ507utsncAjN3iw4DFZpGO/iL8SliT/OwcykvlEFuYgjHbXepg5XSMQHZFFi9p TYu6zNLTyBQOc9CRUwDYkR7DI1rpRkBC11GRs+2m99//I0Ker+sWE0/YJpxi6Bj/ZLFa RtFw== X-Received: by 10.66.163.226 with SMTP id yl2mr6912264pab.73.1408719547665; Fri, 22 Aug 2014 07:59:07 -0700 (PDT) Date: Fri, 22 Aug 2014 22:58:49 +0800 From: luofeiyu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Joel Goldstick , python-list@python.org Subject: Re: Why can not initialize the class? References: <53F752FA.8080902@gmail.com> <53F756BF.1030100@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408719557 news.xs4all.nl 2951 [2001:888:2000:d::a6]:57409 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76796 >>> class Contact(object): ... def __init__(self, first_name=None, last_name=None, ... display_name=None, email="haha@haha"): ... self.first_name = first_name ... self.last_name = last_name ... self.display_name = display_name ... self.email = email ... def print_info(self): ... print(self.display_name, "<" + self.email + ">" ) ... def set_email(self, value): ... print(value) ... self._email = value ... def get_email(self): ... return self._email ... email = property(get_email, set_email) ... >>> >>> contact = Contact() haha@haha why the value in `def set_email(self, value): ` is haha@haha? how haha@haha is called to value in `def set_email(self, value): `? would you mind telling me the process? > >