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
#2
(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(
akbarza likes this post
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: all of attributes and methods related to a special type - by perfringo - Jan-18-2024, 10:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Special Methods in Class Nikhil 3 3,194 Mar-04-2021, 06:25 PM
Last Post: Nikhil
  Special Methods - what are they exactly? bytecrunch 1 2,332 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 7,982 Jan-10-2021, 11:39 PM
Last Post: Evalias123
  Type hinting - return type based on parameter micseydel 2 3,153 Jan-14-2020, 01:20 AM
Last Post: micseydel
  How to Create Very Very Special Class with too many magic methods ? harun2525 5 5,339 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