Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'def': 0.12; 'code?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:OOP': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'define': 0.26; 'this:': 0.26; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'class': 0.32; 'run': 0.32; 'subject:with': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'how': 0.40; 'gotten': 0.74; 'jul': 0.74; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=YeKuiPgogXHp4l29dtF5JE2dW1v50A2L59BTA48SYoI=; b=X9AC2AsGQD11flQXZhqKECSOEwC79Nbq316v4NpiTYguzEN3L9orStVqkgtCFM+rKM YSl9Wi7yncVTZ36CAqA9tVxODQLs/z65DkYotcRGuhlGQlj1AazdkpwLW4OpBut5aRkq yNn4Y6iulhVXzMrPVQYF9EhWCu26FwF+jFJK9dh0E196YGJAITfVRlmtu0QZcW0ILVbR GGSRFaYoS4nU3DM3HPyD4FLgXmmuOl7748G3JDFGsyMG/Eqv0zRI6O6cPWwAvJ17NHyC 8stOOncEsRlUmbau8SkkJ7b8C45PdlA+Deja7MAyvsFmc00lhWYQdEPyKwG2cKHdTG9q vX2A== MIME-Version: 1.0 X-Received: by 10.52.166.71 with SMTP id ze7mr192392vdb.69.1404392469488; Thu, 03 Jul 2014 06:01:09 -0700 (PDT) In-Reply-To: References: <7020a5d8-96a9-4fa4-8e69-4c7593dedee3@googlegroups.com> Date: Thu, 3 Jul 2014 23:01:09 +1000 Subject: Re: OOP with MyTime From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404392478 news.xs4all.nl 2916 [2001:888:2000:d::a6]:41246 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73901 On Thu, Jul 3, 2014 at 10:51 PM, wrote: > So I've now gotten this: > class MyTime: > def between(self, t1, t2): > return (t1.hours, t1.minutes, t1.seconds) <= (self.hours, self.minutes, self.seconds) and (self.hours, self.minutes, self.seconds) <= (t2.hours, t2.minutes, t2.seconds) > print("between(t2, t3, t1) =", between(t2, t3, t1)) And what happens when you run this code? A NameError, I would expect. Do you understand how to define and call methods? ChrisA