Pavel Volkov sai...@lists.xtsubasa.org writes:
The attribute list is different now and there's no __dict__ and the
object does not accept new attributes.
Please explain what's going on.
It's a leaky abstraction, unfortunately.
By default, all user-defined types will provide their instances
On 23Apr2014 09:39, Pavel Volkov sai...@lists.xtsubasa.org wrote:
There are some basics about Python objects I don't understand.
Consider this snippet:
class X: pass
...
x = X()
dir(x)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
'__eq__', '__format__', '__ge__',
2014-04-23 8:11 GMT+02:00 Cameron Simpson c...@zip.com.au:
On 23Apr2014 09:39, Pavel Volkov sai...@lists.xtsubasa.org wrote:
There are some basics about Python objects I don't understand.
Consider this snippet:
class X: pass
...
x = X()
dir(x)
['__class__', '__delattr__',
On Wed, Apr 23, 2014 at 03:48:32PM +0200, Amirouche Boubekki wrote:
2014-04-23 8:11 GMT+02:00 Cameron Simpson c...@zip.com.au:
Look up the __slots__ dunder var in the Python doco index:
https://docs.python.org/3/glossary.html#term-slots
You'll see it as a (rarely used, mostly
2014-04-23 15:59 GMT+02:00 Phil Connell pconn...@gmail.com:
On Wed, Apr 23, 2014 at 03:48:32PM +0200, Amirouche Boubekki wrote:
2014-04-23 8:11 GMT+02:00 Cameron Simpson c...@zip.com.au:
Look up the __slots__ dunder var in the Python doco index:
On Wed, Apr 23, 2014 at 04:21:26PM +0200, Amirouche Boubekki wrote:
2014-04-23 15:59 GMT+02:00 Phil Connell pconn...@gmail.com:
On Wed, Apr 23, 2014 at 03:48:32PM +0200, Amirouche Boubekki wrote:
2014-04-23 8:11 GMT+02:00 Cameron Simpson c...@zip.com.au:
Look up the __slots__ dunder
On Wednesday, April 23, 2014 10:21:26 PM UTC+8, Amirouche Boubekki wrote:
2014-04-23 15:59 GMT+02:00 Phil Connell pcon...@gmail.com:
On Wed, Apr 23, 2014 at 03:48:32PM +0200, Amirouche Boubekki wrote:
2014-04-23 8:11 GMT+02:00 Cameron Simpson c...@zip.com.au:
Look up the
There are some basics about Python objects I don't understand.
Consider this snippet:
class X: pass
...
x = X()
dir(x)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__',