Skip to content

Magenaut

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

python-datamodel

What are metaclasses in Python?

August 22, 2022 by Magenaut

What are metaclasses? What are they used for?

Categories Python, Q&A Tags metaclass, oop, python, python-class, python-datamodel 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 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

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 is the ‘is’ keyword implemented in Python?

August 20, 2022 by Magenaut

… the is keyword that can be used for equality in strings.

Categories Python, Q&A Tags built-in, python, python-datamodel Leave a comment

Implementing slicing in __getitem__

August 19, 2022 by Magenaut

I am trying to implement slice functionality for a class I am making that creates a vector representation.

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

Get fully qualified class name of an object in Python

August 18, 2022 by Magenaut

For logging purposes I want to retrieve the fully qualified class name of a Python object. (With fully qualified I mean the class name including the package and module name.)

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

Is everything greater than None?

August 16, 2022 by Magenaut

Is there a Python built-in datatype, besides None, for which:

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

Schrödinger’s variable: the __class__ cell magically appears if you’re checking for its presence?

August 16, 2022 by Magenaut

There’s a surprise here:

Categories Python, Q&A Tags closures, python, python-3.x, python-datamodel Leave a comment

Prevent creating new attributes outside __init__

August 14, 2022 by Magenaut

I want to be able to create a class (in Python) that once initialized with __init__, does not accept new attributes, but accepts modifications of existing attributes. There’s several hack-ish ways I can see to do this, for example having a __setattr__ method such as

Categories Python, Q&A Tags class, oop, python, python-3.x, python-datamodel 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