Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get help options for data types in python

Tags:

python

using below for loop to see all help options for dictionaries

for me in dir(dict): if not me.startswith("__"): help(dict.me)

error is AttributeError: type object 'dict' has no attribute me

Once resolve it i can see all data types help options

like image 247
radas Avatar asked Nov 18 '16 06:11

radas


People also ask

How do you specify data types in Python?

Python is a dynamically-typed language, which means that we don't have to specify data types when we create variables and functions. While this reduces the amount of code we need to write, the workload that we save is in turn added to the next developer that needs to understand and debug the existing function!

Can we specify data type in Python?

Python is an object-orientated language, and as such it uses classes to define data types, including its primitive types.


2 Answers

pivoting from the only answer and your question:

for me in dir(dict):
    if not me.startswith('__'):
        help(getattr(dict, me))
like image 127
salparadise Avatar answered Nov 02 '22 23:11

salparadise


for me in dir(dict):
    if not me.startswith('__'):
         help(me)
like image 25
user2693928 Avatar answered Nov 02 '22 23:11

user2693928