mark.sea...@gmail.com wrote:
On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote:
On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote:
...
... Also, you shouldn't use `class_ ` as the name of the first argument to
__new__(). Use `cls` instead since that's the conventional name
2009/3/29 Scott David Daniels scott.dani...@acm.org:
mark.sea...@gmail.com wrote:
On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote:
On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote:
...
... Also, you shouldn't use `class_ ` as the name of the first argument
to
On Mar 29, 11:16 pm, Chris Rebert c...@rebertia.com wrote:
2009/3/29 Scott David Daniels scott.dani...@acm.org:
mark.sea...@gmail.com wrote:
On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote:
On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote:
...
... Also, you
mark.sea...@gmail.com writes:
So I want a class ShadowRegister, which just has a value that I can
do get/set bit sel and slice ops. I got that working with __init__.
It was subclass from object. Then I wanted a RegisterClass that
was a subclass of ShadowRegister, which would read a hardware
mark.sea...@gmail.com wrote:
Python 2.5.3 for business reasons.
So I want a class ShadowRegister, which just has a value that I can do
get/set bit sel and slice ops. I got that working with __init__. It
was subclass from object. Then I wanted a RegisterClass that was a
subclass of
On Mar 30, 2:30 am, Jan Decaluwe j...@jandecaluwe.com wrote:
mark.sea...@gmail.com wrote:
Python 2.5.3 for business reasons.
So I want a class ShadowRegister, which just has a value that I can do
get/set bit sel and slice ops. I got that working with __init__. It
was subclass from
It needs to read HW reg and adjust ChipRegister value, or
ShadowRegister and change the HW value (order was reversed). I will
look at MyHDL again though to see if there is some reason it can print
class subclassed from intbv, or if it even has a class subclassed from
intbv, without casting as a
Here again is example:
from ctypes import *
class REG_INFO(Structure):
_fields_ = [
('address', c_ubyte),
('message', c_char * 256),
('size', c_ubyte)
]
class myclass(object):
#
# def __new__(class_, init_val, size, reg_info):
def __init__(self,
mark.sea...@gmail.com wrote:
Here again is example:
from ctypes import *
class REG_INFO(Structure):
_fields_ = [
('address', c_ubyte),
('message', c_char * 256),
('size', c_ubyte)
]
class myclass(object):
#
# def __new__(class_, init_val, size,
mark.sea...@gmail.com wrote:
...
It seems like there's no way to do what I'm trying. I am confined to
Python 2.5.3 for business reasons.
So I want a class ShadowRegister, which just has a value that I can do
get/set bit sel and slice ops. I got that working with __init__. It
was subclass
mark.sea...@gmail.com writes:
class myclass(object):
#
# def __new__(class_, init_val, size, reg_info):
def __init__(self, init_val, size, reg_info):
# self = object.__new__(class_)
self.reg_info = reg_info
print self.reg_info.message
self.val =
On Mar 30, 9:40 am, Scott David Daniels scott.dani...@acm.org wrote:
mark.sea...@gmail.com wrote:
...
It seems like there's no way to do what I'm trying. I am confined to
Python 2.5.3 for business reasons.
So I want a class ShadowRegister, which just has a value that I can do
get/set
On Mar 30, 10:53 am, David Bolen db3l@gmail.com wrote:
mark.sea...@gmail.com writes:
class myclass(object):
#
# def __new__(class_, init_val, size, reg_info):
def __init__(self, init_val, size, reg_info):
# self = object.__new__(class_)
self.reg_info =
If I cast it long then it prints fine, but I was hoping there would be
a slicker way (to accomplish this in the class itself).
print 'bird val = 0x%016X' % long(bird)
--
http://mail.python.org/mailman/listinfo/python-list
After taking out the class myclass stuff, the code worked for me in
Python 2.6.1, through the cat line. Could you please tell us what
version of Python you're running this on?
import sys
print Python version: , sys.version
yielded (on my machine)
Python version: 2.6.1 (r261:67517, Dec 4
On Mar 30, 11:53 am, Dave Angel da...@ieee.org wrote:
After taking out the class myclass stuff, the code worked for me in
Python 2.6.1, through the cat line. Could you please tell us what
version of Python you're running this on?
import sys
print Python version: , sys.version
yielded (on
On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote:
On Mar 30, 11:53 am, Dave Angel da...@ieee.org wrote:
After taking out the class myclass stuff, the code worked for me in
Python 2.6.1, through the cat line. Could you please tell us what
version of Python you're running this on?
On Mar 30, 12:05 pm, mark.sea...@gmail.com wrote:
On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote:
On Mar 30, 11:53 am, Dave Angel da...@ieee.org wrote:
After taking out the class myclass stuff, the code worked for me in
Python 2.6.1, through the cat line. Could you please tell
Sorry, I meant I took out the stuff *before* the definition of class
myclass, and also those things that referred to it. I didn't want to
import ctypes, because it couldn't have any effect on the problem at hand.
Since then I see that you've succeeded with the __int__() method call,
and
On Mon, 30 Mar 2009 18:57:01 +0100, mark.sea...@gmail.com wrote:
Thanks Scott. I think you are saying don't try to subclass from type
long, because it is immutable (cannot be changed). If I subclass from
type object, then the value can be changed, but I still can't print
without explicitely
Just as feedback, I went back to the __init__ style routine, weeded
out a few things, installed python 2.6.1, and it works great. Thanks
for all your help. Now I've got to convince 1000 people at my company
to switch. That's going to be the tough part.
--
Hi. So now I have this class that works to allow me to pass in my
reg_info struct. However when I try to make it part of my class it
gets an error global name 'self' is not defined. I've never seen
this error before. If I comment out the line below 'self.reg_info =
reg_info then the code
On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote:
Hi. So now I have this class that works to allow me to pass in my
reg_info struct. However when I try to make it part of my class it
gets an error global name 'self' is not defined. I've never seen
this error before. If I
On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote:
On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote:
Hi. So now I have this class that works to allow me to pass in my
reg_info struct. However when I try to make it part of my class it
gets an error global name 'self' is
24 matches
Mail list logo