Anvil Community Forum

[DONE] Class property hints in IDE

If I create an instance of a class, the autocomplete shows me property options when I use it. Each option has a hint which for me just shows (for example) “data - the ‘data’ property”

Can I make that something more meaningful?

Can you show us an example of what you mean? Is this a Custom Component or a class defined in another module?

It’s my own class defined in a client module but often imported into server side modules :

class Response:
  def __init__(self,data = None):
    self._status = 0
    self._text = ""
    self._data = None
  def status(self):
    return self._status
  def status(self,value):
    self._status = int(value)
  def text(self):
    return self._text
  def text(self,value):
    self._text = str(value)
  def data(self):
    return self._data
  def data(self,value):
    self._data = value
  def serialise(self,**params):
    status = params.get("status",self.status)
    text = params.get("text",self.text)
    data = params.get("data",
    return {

Oh, what a nice idea! Given that I recently had my grubby fingers in the autocompleter (for reasons you’ll see shortly :wink: ), I’ll make those properties honour doc-strings just like functions do.