[issue7036] Doc/reference/datamodel: Slots description needs update

2009-10-02 Thread Sebastian Thiel

New submission from Sebastian Thiel :

The section starting with:
"If a class defines a slot also defined in a base class, the instance
variable
  defined by the base class slot is inaccessible rendering the meaning
of the
  program undefined. [...]"

would need to be revisited as it claims that a check for this issue
might be added in future. As far as I can tell, it has been added in
Python 2.4 or earlier as I get a TypeError in that case.

The attached diff is my attempt to fix this issue.

Kind Regards, 
Sebastian

--
assignee: georg.brandl
components: Documentation
files: docfix.diff
keywords: patch
messages: 93447
nosy: Byron, georg.brandl
severity: normal
status: open
title: Doc/reference/datamodel: Slots description needs update
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 
3.1, Python 3.2
Added file: http://bugs.python.org/file15020/docfix.diff

___
Python tracker 
<http://bugs.python.org/issue7036>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7036] Doc/reference/datamodel: Slots description needs update

2009-10-02 Thread Sebastian Thiel

Sebastian Thiel  added the comment:

Additional Information:

"multiple bases have instance lay-out conflict"

This happens only if I add __slots__ to the bases so that there is no
dict. I can reproduce this easily by indirectly deriving a class from
two bases that both define the same slot. 
It only happens if all classes define __slots__ so there is no dict.

class ac( object ):
__slots__ = "a"

class bc( ac ):
__slots__ = "b"

class cc( ac ):
__slots__ = "c"

class cannotbecreated( bc,cc ):
 pass
 # raises an error.

Actually I don't know whether this is intended or if it is related to
the documentation section I pointed at.

--

___
Python tracker 
<http://bugs.python.org/issue7036>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com