Re: Best practice: Sharing object between different objects

2015-02-23 Thread Ian Kelly
On Mon, Feb 23, 2015 at 1:02 PM, wrote: > What's REALLY interesting is that this happens: > import myModule myModule.myInt > 1 myModule.myInt = 2 myModule.myInt > 2 del myModule import myModule myModule.myInt > 2 > > I would REALLY expect that deleting the modul

Re: Best practice: Sharing object between different objects

2015-02-23 Thread Rob Gaddi
On Sat, 21 Feb 2015 04:15:50 -0800, pfranken85 wrote: > Hello! > > I have a best-practice question: Imagine I have several hardware devices > that I work with on the same I2C bus and I am using the python smbus > module for that purpose. The individual devices are sensors, ADC, DAC > components.

Re: Best practice: Sharing object between different objects

2015-02-21 Thread Paul Rubin
pfranke...@gmail.com writes: > ADC, DAC components. As I said, I would like to derive the > corresponding classes from one common class, let's say I2CDevice, so > that they can share the same bus connection (I don't want to do a > import smbus, ..., self.bus = smbus.SMBus(1) all the time). I don'

Re: Best practice: Sharing object between different objects

2015-02-21 Thread Dave Angel
On 02/21/2015 07:15 AM, pfranke...@gmail.com wrote: Hello! I have a best-practice question: Imagine I have several hardware devices that I work with on the same I2C bus and I am using the python smbus module for that purpose. The individual devices are sensors, ADC, DAC components. As I said,