Yes that is roughly what I meant. GNU Radio uses a lot of sub-classing--if
this is the correct term. For example all blocks inherit hier_block2 which
has methods such as connect for connecting two blocks together. I wondered if
the instance named self wasn't being passed as a replacement for the
dave wrote:
Is it even possible to replace the implicit self argument of the initializer
by passing something else? If so, what would be the syntax.
Yes, by calling an "unbound method".
Consider this class:
class MyClass:
def func(self, x):
return x+1
When you run this code,
dave wrote:
Is it even possible to replace the implicit self argument of the initializer
by passing something else? If so, what would be the syntax.
Im not sure this is what you mean but...
When you call a method on an object like:
class MyClass:
def aMethod(self,spam): pass
anObject= M
Is it even possible to replace the implicit self argument of the initializer
by passing something else? If so, what would be the syntax.
If you want to look at the code its all here:
https://www.cgran.org/browser/projects/ucla_zigbee_phy/trunk/src
The cc2420_txtest.py is in ./examples and the c
I was dimly aware of the functioning of booleans, but I see now that it
doesn't specify an actual boolean type. Still, the code confuses me. Is the
usage of pad_for_usrp consistent with it being treated as a boolean? Why
would the entire self reference be transmitted then?
Example code again:
dave wrote:
I was dimly aware of the functioning of booleans, but I see now that it
doesn't specify an actual boolean type. Still, the code confuses me. Is the
usage of pad_for_usrp consistent with it being treated as a boolean? Why
would the entire self reference be transmitted then?
Parame
On Sun, Jul 24, 2011 at 2:07 AM, Steven D'Aprano wrote:
> (Note that among strings, only the empty string counts as nothing. The
> strings 'nothing', 'empty', 'false', 'not a thing', 'nada', 'not a brass
> farthing', "dry as a dingo's donger" etc. are non-empty strings and
> therefore count as tru
dave wrote:
Thank you for the two explanations. I think I have a good idea of what is
going on now with the arguments and keyword arguments.
My only remaining question is the pad_for_usrp argument. The default value is
True so I thought it was a boolean and couldn't have anything to do with th
dave wrote:
My only remaining question is the pad_for_usrp argument. The default value is
True so I thought it was a boolean and couldn't have anything to do with the
"self" that was passed to it. However, I can probably puzzle
that out by looking at how it's used in the code.
I thought th
Thank you for the two explanations. I think I have a good idea of what is
going on now with the arguments and keyword arguments.
My only remaining question is the pad_for_usrp argument. The default value is
True so I thought it was a boolean and couldn't have anything to do with the
"self" that
dave wrote:
class transmit_path(gr.top_block)
[...]
self.packet_transmitter = ieee802_15_4_pkt.ieee802_15_4_mod_pkts(self,
spb=self._spb, msgq_limit=2)
This calls the ieee802_15_4_mod_pkts initializer (not a constructor --
see below) with one posit
On 07/22/2011 06:40 PM, dave wrote:
Hello,
I'm trying to work on GNU Radio and having trouble understanding some of the
Python code. I have a C/C++ coding background. I'm looking at the
ieee802.15.4 code found on CGRAN. It's about 4 years old and runs but doesn't
function anymore so I'm tryin
12 matches
Mail list logo