Hi,
Here k corresponds to a class. Hence k(self) corresponds to creating an
instance of the class referred to by k passing self as the first
parameter, which results in an object.
Regards, Freddie.
On 07/07/2020 06:33, Kiny Wan wrote:
> Hi Freddie and everyone,
> The more you learn, the more problems you encounter! Today, I
> want to discuss about a python operation in backend/openmp/base.py,
> which is very advanced. The code is shown as follow:
>
> # Instantiate mandatory kernel provider classes
> kprovcls = [provider.OpenMPPointwiseKernelProvider,
> blasext.OpenMPBlasExtKernels,
> packing.OpenMPPackingKernels,
> gimmik.OpenMPGiMMiKKernels]
> self._providers = [k(*self*) for k in kprovcls]
>
> The '*self*' is brought into the class 'k'.
> Using print function, I found that k(*self*) represents object and k
> denotes class. *I am wondering what impact this will have? *
>
> print(provider.OpenMPPointwiseKernelProvider(self))
> <pyfr.backends.openmp.provider.OpenMPPointwiseKernelProvider object at
> 0x7f5551a03b70>
> print(provider.OpenMPPointwiseKernelProvider)
> <class 'pyfr.backends.openmp.provider.OpenMPPointwiseKernelProvider'>
>
> --
> You received this message because you are subscribed to the Google
> Groups "PyFR Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
pyfrmailingli...@googlegroups.com
> <mailto:
pyfrmailingli...@googlegroups.com>.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/pyfrmailinglist/df2ef118-0f48-4e9e-a018-03c00c1e1b60n%40googlegroups.com
> <
https://groups.google.com/d/msgid/pyfrmailinglist/df2ef118-0f48-4e9e-a018-03c00c1e1b60n%40googlegroups.com?utm_medium=email&utm_source=footer>.