[Tutor] seeking design pattern
bob gailer
bgailer at gmail.com
Mon Aug 26 09:45:18 EDT 2019
On 24Aug2019 20:39, bob gailer <bgailer at gmail.com> wrote:
>> I desire to import some functions form a module and give them access
>> to names in the main module namespace. Example:
Problem solved:
imported functions are assigned to the run methods of classes whose
names are the title() version of the function name, using the
__init_subclass__ method of the superclass.
The "shared functions", those that I want to make available to the
imported functions, are methods of the superclass.
So a function to be imported is defined thus:
def foo(self, *args():
self.shared_function()
This description is IMHO complete but perhaps too terse. If you want
further explanation, just let me know.
--
Bob Gailer
More information about the Tutor
mailing list