Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

introspection

What does the slash mean in help() output?

August 21, 2022 by Magenaut

What does the / mean in Python 3.4’s help output for range before the closing parenthesis?

Categories Python, Q&A Tags introspection, parameters, python, python-3.x Leave a comment

How can you print a variable name in python?

August 21, 2022 by Magenaut

Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to In [53]: namestr(choice) Out[53]: 'choice' for use in making a dictionary. There’s a good way to do this and I’m just missing it. EDIT: The reason to do this is thus. … Read more

Categories Python, Q&A Tags dictionary, introspection, python, variables Leave a comment

Is there a built-in function to print all the current properties and values of an object?

August 21, 2022 by Magenaut

So what I’m looking for here is something like PHP’s print_r function.

Categories Python, Q&A Tags debugging, introspection, pretty-print, python, python-datamodel Leave a comment

How to get the caller’s method name in the called method?

August 21, 2022 by Magenaut

Python: How to get the caller’s method name in the called method?

Categories Python, Q&A Tags introspection, python Leave a comment

How to get method parameter names?

August 21, 2022 by Magenaut

Given the Python function:

Categories Python, Q&A Tags decorator, introspection, python, python-datamodel Leave a comment

Determine function name from within that function (without using traceback)

August 20, 2022 by Magenaut

In Python, without using the traceback module, is there a way to determine a function’s name from within that function?

Categories Python, Q&A Tags function, introspection, python, traceback Leave a comment

Getting the class name of an instance?

August 20, 2022 by Magenaut

How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance has been derived?

Categories Python, Q&A Tags instanceof, introspection, python, python-datamodel Leave a comment

How can I get the name of an object?

August 19, 2022 by Magenaut

Is there any way to get the name of an object in Python? For instance:

Categories Python, Q&A Tags introspection, python Leave a comment

Finding what methods a Python object has

August 19, 2022 by Magenaut

Given a Python object of any kind, is there an easy way to get the list of all methods that this object has?

Categories Python, Q&A Tags introspection, python Leave a comment

List all the modules that are part of a python package?

August 17, 2022 by Magenaut

Is there a straightforward way to find all the modules that are part of a python package? I’ve found this old discussion, which is not really conclusive, but I’d love to have a definite answer before I roll out my own solution based on os.listdir().

Categories Python, Q&A Tags introspection, module, packages, python, python-import Leave a comment
Older posts
Page1 Page2 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress