On Thu, Aug 30, 2012 at 10:50 PM, <boltar2003@boltar.world> wrote: > On Thu, 30 Aug 2012 13:14:57 +0100 > MRAB <pyt...@mrabarnett.plus.com> wrote: >>What don't you ask Python? I'm sure you'' get something like this: >> >> >>> type(s) >><class 'posix.stat_result'> > > Umm , no I don't. > >>>> type(s) > <type 'posix.stat_result'> > > Which isn't terrible helpful.
That's actually the same thing, except for a slight difference between Python 2 and Python 3. > If its a class , why is it when I create my own class I get a completely > different output with print and type? > >>>> >>>> class foo(object): > .. def __init__(self): > .. pass > .. >>>> f=foo() >>>> print f > <__main__.foo object at 0xb743956c> >>>> type(f) > <class '__main__.foo'> Yep, you're using Python 2. A few things are subtly different. Unless you have good reason not to, do consider moving to Python 3; all sorts of things are easier. Python 2 is basically not being developed any more. http://www.python.org/dev/peps/pep-0404/ Alternatively, accept that what people are going to quote to you here may be slightly different from what you see. In any case, Python's introspection facilities and help() features are available on both branches, so most of what has been said in this thread still applies. ChrisA -- http://mail.python.org/mailman/listinfo/python-list