Author Topic: auto list members in Python when type hints provided  (Read 324 times)

rowbearto

  • Senior Community Member
  • Posts: 1379
  • Hero Points: 104
auto list members in Python when type hints provided
« on: February 21, 2019, 05:13:33 pm »
In Python if a type hint is provided, it would be nice to have "auto list" work.

Example:
Code: [Select]
#!/usr/bin/python
class MyClass:
  def __init__(self):
    self.member1 = 5
    self.member2 = 3

  def myClassMethod(self):
    self.member1 = 10

def sampleFunc(myClassObj : MyClass):
  # After typing the dot below would be nice to get a list of
  # the MyClass members/methods
  myClassObj.

  myString : str = "mystring"
  # Type "dot" below, can't get string methods documented here
  #   https://docs.python.org/3/library/stdtypes.html#string-methods
  #   For example I would like to have "split" as a choice of
  #   a method to choose
  myString.

And if there is no type hint, I would like a way to tell SlickEdit what the type is so I can get a member/method list.
« Last Edit: February 21, 2019, 05:22:01 pm by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 1379
  • Hero Points: 104
Re: auto list members in Python when type hints provided
« Reply #1 on: February 22, 2019, 02:23:40 pm »
And if type hints not provided (such as older Python versions, like Python 2) - maybe I could put something in the comments to let SlickEdit know the type of a variable?

In the example from my original post, perhaps something in the comments that lets Slick know that "myClassObj" is of type "MyClass" in a python comment like this:

# myClassObj uses type MyClass

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2706
  • Hero Points: 413
Re: auto list members in Python when type hints provided
« Reply #2 on: February 22, 2019, 03:18:45 pm »
This looks like more of a bug than a feature.  I'll file a defect and let our Python guys know.