Python Forum
all of attributes and methods related to a special type
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
all of attributes and methods related to a special type
#4
(Jan-18-2024, 10:59 AM)perfringo Wrote:
(Jan-18-2024, 06:48 AM)akbarza Wrote: how can I see all attributes and methods related to a special type? for example, I want to see all methods and attributes related to lists, how can I do it?

For that there is the documentation. However, Python's interactive interpreter has helpful feature as well:

>>> list.   # press two times TAB
list.append(  list.clear(   list.copy(    list.count(   list.extend(  list.index(   list.insert(  list.mro()    list.pop(     list.remove(  list.reverse( list.sort(
>>> help(list.count)
Help on method_descriptor:

count(self, value, /)
    Return number of occurrences of value.

# works on instances as well:
>>> spam = [1, 2]
>>> spam.   # two times TAB
spam.append(   spam.clear()   spam.copy()    spam.count(    spam.extend(   spam.index(    spam.insert(   spam.pop(      spam.remove(   spam.reverse() spam.sort(

thanks for reply
In IDLE, I typed list. and then pressed the tab key twice, it became list. and popped up a small window that contained all methods related to the list type. I tried several times, but I was not successful. also, I did it for spam ( as you have defined), but again I was not successful. what is the problem?
Reply


Messages In This Thread
RE: all of attributes and methods related to a special type - by akbarza - Jan-19-2024, 07:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Special Methods in Class Nikhil 3 2,363 Mar-04-2021, 06:25 PM
Last Post: Nikhil
  Special Methods - what are they exactly? bytecrunch 1 1,720 Feb-07-2021, 01:38 AM
Last Post: Larz60+
  Although this is a talib related Q it's mostly related to python module installing.. Evalias123 4 5,819 Jan-10-2021, 11:39 PM
Last Post: Evalias123
  Type hinting - return type based on parameter micseydel 2 2,555 Jan-14-2020, 01:20 AM
Last Post: micseydel
  How to Create Very Very Special Class with too many magic methods ? harun2525 5 4,440 Apr-13-2017, 10:18 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020