SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Features and/or Improvements => Topic started by: rowbearto on February 21, 2019, 05:13:33 PM

Title: auto list members in Python when type hints provided
Post by: rowbearto 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.
Title: Re: auto list members in Python when type hints provided
Post by: rowbearto 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
Title: Re: auto list members in Python when type hints provided
Post by: Dennis 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.