[QGIS-Developer] QgsProcessingAlgorithm createInstance

Nyall Dawson nyall.dawson at gmail.com
Wed Feb 20 15:22:13 PST 2019


On Thu, 21 Feb 2019 at 07:30, Caio Hamamura <caiohamamura at gmail.com> wrote:
>
> QgsProcessingAlgorithm needs to implement this useless method (createInstance) in my view of point.
>
> Why do we even need the createInstance method? Couldn’t it be generic:
>
> def createInstance(self):
>     return self.__class__()

QgsProcessingAlgorithm is a c++ class, which has no concept of
metaclasses and so requires subclasses to manually implement this
method.

But it should be possible to bake this into the PyQGIS bindings alone
- see https://github.com/qgis/QGIS/pull/9226

Nyall

>
> Greetings,
> Caio Hamamura
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list