[Tutor] introspection

Dave Angel davea at davea.name
Tue Apr 21 12:40:05 CEST 2015


On 04/21/2015 01:21 AM, Danny Yoo wrote:
> What's supposed to happen in this situation?
>
>
> ##########################################
> class Person(object):
>      def __init__(self): pass
>
> j = Person()
> john = j
> jack = j
> ##########################################
>
> What single name should we get back from the single Person object
> here?  "j", "john", or "jack"?


And what name should you get from the second Person() object created here?

mylist = [Person(), Person(), Person()]




-- 
DaveA


More information about the Tutor mailing list