On Tue, 26 Sept 2023 at 01:39, Jonathan Gossage via Python-list
wrote:
>
> Many thanks, all. It turned out that my problem was not fully understanding
> the use and power of the unpack operator *. Using it to activate my
> generator made things start to work. I changed the line where I invoked the
Mon, Sep 25, 2023 at 11:15 AM Thomas Passin via Python-list <
python-list@python.org> wrote:
> On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote:
> > I am having a problem using generator expressions to supply the arguments
> > for a class instance initialization.
On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote:
I am having a problem using generator expressions to supply the arguments
for a class instance initialization. The following example shows the
problem:
class test1(object):
def __init__(self, a, b):
self.name = a
y = test1(*[a for a in st])
y = test1(*st)
Maybe any of these would be ok for you?
Regards,
DG
> On 25 Sep 2023, at 17:15, Jonathan Gossage via Python-list
> wrote:
>
> I am having a problem using generator expressions to supply the arguments
> for a class instance init
I am having a problem using generator expressions to supply the arguments
for a class instance initialization. The following example shows the
problem:
class test1(object):
def __init__(self, a, b):
> self.name = a
self.value = b
st = 'Programming Renaissance, An