Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'method,': 0.07; 'problem?': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.10; 'doesnt': 0.16; 'java.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'subject:Objects': 0.16; 'string': 0.17; 'wrote:': 0.17; '>>>': 0.18; 'supposed': 0.21; 'object.': 0.22; 'feature': 0.24; 'pass': 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'implicitly': 0.29; 'invoke': 0.29; 'methods.': 0.29; 'class': 0.29; "i'm": 0.29; 'unlike': 0.30; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'created': 0.36; 'but': 0.36; 'too': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'easy': 0.60; 'first': 0.61; 'conclusions': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Objects in Python Date: Wed, 22 Aug 2012 16:36 +0200 Organization: None References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p50849047.dip.t-dialin.net User-Agent: KNode/4.7.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345646167 news.xs4all.nl 6983 [2001:888:2000:d::a6]:43151 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27639 shaun wrote: > I'm having an issue its my first time using python and i set up a class > one of the methods is supposed to return a string but instead returns: > > 389E0>> > > Im very new to python and the object orientated feature doesnt seem to be > as well put together as Java. It's definitely too early for you to draw conclusions ;) > Can anyone help with this problem? You have successfully created a bound method, now you need to invoke it: >>> class Param(object): ... def returnString(self): ... return "hello" ... >>> p = Param() >>> p.returnString > >>> p.returnString() 'hello' Unlike some other langages Python does not implicitly invoke functions or methods. That makes it easy to pass them around like any other object.