On Tue, Mar 31, 2020 at 8:20 AM Peter Otten <__pete...@web.de> wrote:
>
> Chris Angelico wrote:
> > but an awkward way to spell it. If you mean to call the original wrap
> > method, it would normally be spelled super().wrap(para) instead.
>
> Probably a workaround because super() cannot do its magic in the list
> comprehensions namespace. Another workaround is to define
>
> wrap = super().wrap
>
> and then use just wrap() in the listcomp.
>

Ah ha, I didn't think of that. And yes, I would agree, that's probably
the cleanest way. Alternatively, the longhand super(__class__, self)
should work too, as I believe __class__ isn't redefined by the
implicit closure.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to