Skip to content
Magenaut

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 →

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress