Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80017

Re: Classes

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'beginner': 0.05; '__init__': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.12; 'language.': 0.14; '__new__': 0.16; 'argument:': 0.16; 'ast': 0.16; 'constructs': 0.16; 'instances,': 0.16; 'positional': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:n 50': 0.16; 'subject:Classes': 0.16; 'typeerror:': 0.16; '\xe9crit': 0.16; 'language': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'pass': 0.26; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'file': 0.32; 'class': 0.32; '(most': 0.33; 'but': 0.35; 'instances': 0.36; 'doing': 0.36; 'method': 0.36; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'our': 0.64; 'charset:windows-1252': 0.65; 'age.': 0.84; 'received:btcentralplus.com': 0.84; 'received:86': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Classes
Date Fri, 31 Oct 2014 14:11:14 +0000
References <51755at03r0bidjqh3qf0hhpvjr8756ill@4ax.com> <545350c3$0$23449$426a74cc@news.free.fr>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host86-178-21-119.range86-178.btcentralplus.com
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To <545350c3$0$23449$426a74cc@news.free.fr>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15355.1414764692.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414764692 news.xs4all.nl 2909 [2001:888:2000:d::a6]:44074
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80017

Show key headers only | View raw


On 31/10/2014 09:05, ast wrote:
>
> "Seymore4Head" <Seymore4Head@Hotmail.invalid> a écrit dans le message de
> news:51755at03r0bidjqh3qf0hhpvjr8756ill@4ax.com...
>> class pet:
>>    def set_age(self,age):
>>        self.age=age
>>    def get_age(self):
>>        return self.age
>> pax=pet
>> pax.set_age(4)
>>
>> Traceback (most recent call last):
>>  File "C:\Functions\test.py", line 18, in <module>
>>    pax.set_age(4)
>> TypeError: set_age() missing 1 required positional argument: 'age'
>>
>> I am trying to pass 4 as the age.  Obviously I am doing it wrong.
>>
>
> Hi
>
> I am a beginner too, but I find it strange that your
> pet class has no __init__ method to construct
> instances

__init__ initialises instances, __new__ constructs them

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Classes   Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-30 16:16 -0400
  Re: Classes sohcahtoa82@gmail.com - 2014-10-30 13:33 -0700
    Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-30 17:00 -0400
  Re: Classes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-10-30 13:34 -0700
    Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-30 17:00 -0400
  Re: Classes Larry Hudson <orgnut@yahoo.com> - 2014-10-30 14:28 -0700
    Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-30 17:34 -0400
      Re: Classes sohcahtoa82@gmail.com - 2014-10-30 18:21 -0700
      Re: Classes alister <alister.nospam.ware@ntlworld.com> - 2014-10-31 09:59 +0000
        Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 10:07 -0400
  Re: Classes   "ast" <nomail@invalid.com> - 2014-10-31 10:05 +0100
    Re: Classes   "ast" <nomail@invalid.com> - 2014-10-31 10:18 +0100
      Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-10-31 20:21 +1100
    Re: Classes   Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 10:05 -0400
      Re: Classes Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-31 08:47 -0600
        Re: Classes Grant Edwards <invalid@invalid.invalid> - 2014-10-31 15:49 +0000
          Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 12:31 -0400
            Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 03:37 +1100
              Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 12:47 -0400
                Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 04:02 +1100
                Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 13:31 -0400
                Re: Classes Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-31 12:39 -0500
                Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 13:57 -0400
                Re: Classes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-10-31 10:40 -0700
                Re: Classes Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-01 11:17 +1300
                Re: Classes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-01 12:06 +1100
                Re: Classes Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-01 00:12 -0600
                Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 17:32 +1100
                Re: Classes Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-03 00:32 +1300
            Re: Classes Dave Angel <davea@davea.name> - 2014-10-31 13:20 -0400
            Re: Classes Marko Rauhamaa <marko@pacujo.net> - 2014-10-31 19:35 +0200
            Re: Classes Grant Edwards <invalid@invalid.invalid> - 2014-10-31 17:40 +0000
            Re: Classes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-31 18:26 -0400
              Re: Classes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-01 12:09 +1100
      Re: Classes   Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-01 04:06 +1100
        Re: Classes   Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 13:18 -0400
          Re: Classes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-10-31 10:43 -0700
            Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 14:18 -0400
              Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 14:42 -0400
              Re: Classes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-31 18:57 -0400
                Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 19:22 -0400
                Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 19:32 -0400
                Re: Classes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-01 12:00 -0400
                Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-01 12:42 -0400
                Re: Classes Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-02 09:50 +0000
                Re: Classes Tim Delaney <timothy.c.delaney@gmail.com> - 2014-11-02 21:32 +1100
                Re: Classes Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-02 12:27 +0000
                Re: Classes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-02 11:31 -0500
                Re: Classes Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-03 03:12 +0000
                Re: Classes Dan Sommers <dan@tombstonezero.net> - 2014-11-03 06:29 +0000
                Re: Classes Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-04 01:10 +0000
                Re: Classes Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-04 18:30 +1300
                Re: Classes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-03 08:50 -0500
                Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-04 02:34 +1100
                Re: Classes Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-03 07:47 -0700
                Re: Classes Larry Hudson <orgnut@yahoo.com> - 2014-11-02 14:03 -0800
            Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 07:51 +1100
              Re: Classes sohcahtoa82@gmail.com - 2014-10-31 14:24 -0700
                Re: Classes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-10-31 14:40 -0700
                Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 08:56 +1100
                Re: Classes Chris Angelico <rosuav@gmail.com> - 2014-11-01 08:36 +1100
          Re: Classes Grant Edwards <invalid@invalid.invalid> - 2014-10-31 17:43 +0000
    Re: Classes Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-31 14:11 +0000
    Re: Classes   Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 12:49 -0400
      Re: Classes   "ast" <nomail@invalid.com> - 2014-10-31 19:31 +0100
        Re: Classes   Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 14:36 -0400
        Re: Classes Joel Goldstick <joel.goldstick@gmail.com> - 2014-10-31 14:41 -0400
          Re: Classes Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-31 14:56 -0400

csiph-web