Re: package extension problem

2012-02-13 Thread Fabrizio Pollastri
Ok. To be more clear, consider the real python package Pandas. This package defines a Series class and a DataFrame class. The DataFrame is a matrix that can have columns of different type. If I write import pandas as pd df = pd.DataFrame({'A':[1,2,3],'B':[4,5,6]}) a data frame with two cols na

package extension problem

2012-02-12 Thread Fabrizio Pollastri
Hello, I wish to extend the functionality of an existing python package by creating a new package that redefines the relevant classes of the old package. Each new class inherits the equivalent old class and adds new methods. In the new package there is something like the following. import old_p

properties with subscripted variables

2008-08-26 Thread Fabrizio Pollastri
Hi, I work on the python module AVC (http://avc.inrim.it) useful for the development of applications with GUIs. AVC is based on the property mechanism: any a variable controlled by AVC is set as a property, so when it is assigned by the application program, the __set__ function is called and AVC do

Re: merging the global namespaces of two modules

2008-05-22 Thread Fabrizio Pollastri
Jeff wrote: Can you be more specific? modA and modB don't import from each other but both need to access objects in the global namespace of what module? The controlling application? Or do you mean that, for example, modA needs to access some functions in modB, but does not have import statem

merging the global namespaces of two modules

2008-05-22 Thread Fabrizio Pollastri
Hi, just an import problem: a program imports two modules, modA and modB, each module do not known anything about the other module (i.e. no cross imports in them), both modules needs to refer to some functions that are defined in the global namespace of the other module. There is a possible so

different instances with different data descriptors with the same name

2008-02-18 Thread Fabrizio Pollastri
Data descriptors are set as attributes of object types. So if one has many instances of the same class and wants each instance to have a different property (data descriptor) that can be accessed with a unique attribute name, it seems to me that there is no solution with data descriptors. There

Writing a read only attribute

2007-07-06 Thread Fabrizio Pollastri
My code is the following: from Tkinter import * def tk_dummy_call(*args): return root = Tk() # save call address original_tk_call = root.tk.call # disable tcl command execution (this is the read-only attribute) root.tk.call = tk_dummy_call ... some code ... # restore tcl command execution

Writing a read only attribute

2007-07-05 Thread Fabrizio Pollastri
Hello, it is possible to force in some way a write to a read-only attribute of a python object? In which case? Thanks for any answer. F. Pollastri -- http://mail.python.org/mailman/listinfo/python-list

Tkinter: different results from the same tcl script

2007-06-26 Thread Fabrizio Pollastri
Hello, in mixed python-tcl programming I found the following different behaviours of the same tcl script. If I type manually in the python interpreter the following lines >>> from Tkinter import * >>> w = Tk() >>> w.tk.evalfile('my_tcl_script.tcl') where my_tcl_script.tcl is #!/bin/sh

method override inside a module

2007-05-25 Thread Fabrizio Pollastri
Hello, I am trying to override a method of a class defined into an imported module, but keeping intact the namespace of the imported module. For example, let suppose import module_X and in module_X is defined something like class A: ... def method_1():