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.
--
http://mail.python.org/mailman/listinfo
On Mon, 30 Mar 2009 18:57:01 +0100, 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 casting back to long in
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 your
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 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 u
On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote:
> On Mar 30, 11:53 am, Dave Angel 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 sy
On Mar 30, 11:53 am, Dave Angel 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 my m
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
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
On Mar 30, 10:53 am, David Bolen 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 = reg_info
On Mar 30, 9:40 am, Scott David Daniels 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 bit sel an
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.
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 from
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, reg_info
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, init_
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 l
On Mar 30, 2:30 am, Jan Decaluwe 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 "object". Then
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 ShadowRe
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 har
On Mar 29, 11:16 pm, Chris Rebert wrote:
> 2009/3/29 Scott David Daniels :
>
> > mark.sea...@gmail.com wrote:
>
> >> On Mar 29, 9:52 pm, Chris Rebert wrote:
>
> >>> On Sun, Mar 29, 2009 at 9:18 PM, wrote:
>
> ...
>
> >>> ... Also, you shouldn't use `class_ ` as the name of the first argume
2009/3/29 Scott David Daniels :
> mark.sea...@gmail.com wrote:
>>
>> On Mar 29, 9:52 pm, Chris Rebert wrote:
>>>
>>> On Sun, Mar 29, 2009 at 9:18 PM, wrote:
...
>>>
>>> ... Also, you shouldn't use `class_ ` as the name of the first argument
>>> to
>>> __new__(). Use `cls` instead since
mark.sea...@gmail.com wrote:
On Mar 29, 9:52 pm, Chris Rebert wrote:
On Sun, Mar 29, 2009 at 9:18 PM, 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 for
it.
Actually, according to PEP 8,
On Mar 29, 9:52 pm, Chris Rebert wrote:
> On Sun, Mar 29, 2009 at 9:18 PM, 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
On Sun, Mar 29, 2009 at 9:18 PM, 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 comment out the line b
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 runs
24 matches
Mail list logo