Re: Weird behavior on __dict__ attr

2015-02-10 Thread Steven D'Aprano
Shiyao Ma wrote: > Hi. > > My context is a little hard to reproduce. > > NS3 is a network simulation tool written in C++. I am using its Python > binding. > > So the class I am dealing with is from a .so file. So it is written in (probably) C and you don't have source code for it. > Say, I do

Re: Weird behavior on __dict__ attr

2015-02-09 Thread Dave Angel
On 02/09/2015 09:52 PM, Shiyao Ma wrote: Hi. My context is a little hard to reproduce. WHY don't you try? Telling us about a class without showing how it's defined leaves us all guessing. Start by telling us Python version. And if it's 2.x, tell us whether this class is an old style or n

Weird behavior on __dict__ attr

2015-02-09 Thread Shiyao Ma
Hi. My context is a little hard to reproduce. NS3 is a network simulation tool written in C++. I am using its Python binding. So the class I am dealing with is from a .so file. Say, I do the following: % import ns.network.Node as Node # Node is a class # it has a __dict__ attr # Now I insta