40 lines
825 B
Plaintext
40 lines
825 B
Plaintext
From: aa8vb at vislab.epa.gov (Randall Hopper)
|
|
Date: Mon, 5 Apr 1999 14:44:08 GMT
|
|
Subject: Subattributes of classes
|
|
Message-ID: <19990405104408.A807008@vislab.epa.gov>
|
|
X-UID: 1107
|
|
|
|
class A:
|
|
def __init__( self ):
|
|
self.attr = 123
|
|
self.attr.subattr = 456 # <--------- Error!
|
|
|
|
a = A()
|
|
|
|
|
|
This generates an error as I would have expected.
|
|
|
|
However, I see the same syntax in:
|
|
demos/tkinter/matt/canvas-with-scrollbars.py
|
|
|
|
and it works:
|
|
|
|
self.draw = Canvas(self, width="5i", height="5i",
|
|
background="white",
|
|
scrollregion=(0, 0, "20i", "20i"))
|
|
self.draw.scrollX = Scrollbar(self, orient=HORIZONTAL)
|
|
self.draw.scrollY = Scrollbar(self, orient=VERTICAL)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
Why?
|
|
|
|
Randall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|