Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: what is the __dict__ object?
Post: RE: what is the __dict__ object?

(Mar-28-2018, 01:32 PM)snippsat Wrote: (Mar-28-2018, 09:29 AM)aaron1989041 Wrote: i think if id() function gives the same address for two objects,they must be the same object. Use code tags. There...
aaron1989041 General Coding Help 6 4,775 Mar-29-2018, 02:15 AM
    Thread: what is the __dict__ object?
Post: id() function is strange

>>> class A: ... pass ... >>> class B: ... pass ... >>> print(A.__dict__ is B.__dict__,A.__dict__ == B.__dict__,id(A.__dict__),id(B.__dict__)) False False 139925069297...
aaron1989041 General Coding Help 6 4,775 Mar-28-2018, 09:29 AM
    Thread: what is the __dict__ object?
Post: what is the __dict__ object?

CODE TO EXECUTE: class Foo: pass class Foo1: pass class Foo2: pass print(id(Foo),id(Foo.__dict__),type(Foo.__dict__)) print(id(Foo1),id(Foo1.__dict__),type(Foo1.__dict__)) prin...
aaron1989041 General Coding Help 6 4,775 Mar-28-2018, 02:44 AM
    Thread: a __class__ syntax error
Post: a __class__ syntax error

I'm learning the __class__ property,but when I try to execute code below,a syntax error raises: print(1.__class__) from my opinion,in python,everything is object,so do number 1,this code should giv...
aaron1989041 General Coding Help 1 2,200 Mar-26-2018, 09:16 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020