June 2002
Beginner to intermediate
640 pages
14h 24m
English
To understand what I'm going to talk about here, you should have some Java background and have read the API documentation for OutputStream.
Another way to override all of write()'s forms is to override only the abstract version and then just call the others. You can also use a variable number of arguments for write() and then just use the apply() method to execute the nonabstract forms. Let me show you what I mean. (The following code is from Overload.py.)
class OutputScreen2 (OutputStream): def write(self, *args): # If the args length is greater than one or the first # argument is not type IntType, use the apply method. if len(args) > 1 or not type(args[0]) is types.IntType: # Use the apply method to call ...
Read now
Unlock full access