# Bug in how label is handled in Python-based source plugin?

**URL:** https://discourse.paraview.org/t/bug-in-how-label-is-handled-in-python-based-source-plugin/8342
**Category:** ParaView Support
**Tags:** python
**Created:** [November 5, 2021, 7:40pm UTC](https://discourse.paraview.org/t/bug-in-how-label-is-handled-in-python-based-source-plugin/8342 "2021-11-05T19:40:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rweigel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rweigel/32/7897_2.png) [@rweigel](https://discourse.paraview.org/u/rweigel)
#### Post date: [November 5, 2021, 7:40pm UTC](https://discourse.paraview.org/t/bug-in-how-label-is-handled-in-python-based-source-plugin/8342/1 "2021-11-05T19:40:01Z")

</div>

If I change `name=Center` to `name=Center label=The Center` on this line [ParaView/Examples/Plugins/PythonAlgorithm/PythonAlgorithmExamples.py at master · Kitware/ParaView · GitHub](https://github.com/Kitware/ParaView/blob/master/Examples/Plugins/PythonAlgorithm/PythonAlgorithmExamples.py#L38)

and then attempt to execute the plugin from the Python shell using

`PythonbasedSuperquadricSourceExample(Center=(0,0,1))`

I get

> AttributeError: Attribute Center does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add\_attribute() if you really want to add this attribute.

This error goes away if I set `label=Center`. Is there a way to have `label` differ from `name` in a property for a plugin? I am creating a plugin it will be useful for the label to be a bit more informative. A related issue is that when hovering over a label in the menu, I don’t see a pop-up that shows the documentation. If there was a way to show the documentation, then having a label different from the name would not be as important.

Note that if I select `PythonbasedSuperquadricSourceExample` from the `Sources` menu, I see that the label in the properties menu is `The Center` as desired and there is no error. So it seems that the label can be different, but that the labels are used to determine what the valid keyword arguments are for a plugin.

---

<div class="post-metadata">

### Author: ![rweigel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rweigel/32/7897_2.png) [@rweigel](https://discourse.paraview.org/u/rweigel)
#### Post date: [November 8, 2021, 11:42pm UTC](https://discourse.paraview.org/t/bug-in-how-label-is-handled-in-python-based-source-plugin/8342/2 "2021-11-08T23:42:18Z")

</div>

The answer to this is in this post: [Python plugin smproxy keyword arguments aren't working as expected](https://discourse.paraview.org/t/python-plugin-smproxy-keyword-arguments-arent-working-as-expected/4869) In summary, it is best to use `name=label` for plugins written in Python.

I did find a workaround. If I want to provide a more descriptive label, use

```auto
@smproperty.xml('<PropertyGroup label="The center of the object"><Property function="Center" name="Center"/></PropertyGroup>')

```

This will result in bold text above the entry area for the center position that says “The center of the object”. Technically, this is not what `PropertyGroup` is meant for, but it helps clarify things when a `name` does not provide enough of a hint as to what the entry area is for.
