Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Struggeling with collections Date: Mon, 07 Mar 2016 11:31:31 +0200 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <241aeea9-2604-4fa4-bf06-822ba5be143b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="17065"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193C/xNf3087IeKNVH6cBSHZRjH8TE/w7c=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:jyDQWtFZl3BU6DTYWfw7pOBZL2Y= sha1:/9VQ/r3x2ERVcHHKddssbv0VjgI= Xref: csiph.com comp.lang.python:104200 Faling Dutchman writes: > I am just starting off in python, but have good knowledge of both Java > and C#. Now is the problem that I need to have multiple instances of ... > it prints: <__main__.Item object at 0x02EBF3B0> > > So that is not usefull to me. There can be an infinite amount of ... > and it has to show all the parameters of the class Item and not say > "ive got an object at this memory address, have a nice day" Others have now told you that your class has a special method that defines the string representation of instances. What you are seeing is the default. You can specify your own. I just want to add that Java does it the same way. Surely this hasn't changed? (I've never known C#, so no comment on that.)