Stef Mientki wrote:

> Maric Michaud wrote:

   def bit(index):
>>     def fset(self, value):

>>         value    = ( value & 1L ) << index
>>         mask     = ( 1L ) << index
>>         self._d  = ( self._d & ~mask ) | value
>>     def fget(self):

>>         return ( self._d >> index ) & 1
>>     return property(**locals())
>> 
>> 
>> class cpu_ports(object) :

       p1 = bit(1)
       p2 = bit(2)
       p3 = bit(3)
       p4 = bit(4)
       p5 = bit(5)

> Looks good, but I miss the index :-(

No more.

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to