Skip to content

Magenaut

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

python-internals

Are dictionaries ordered in Python 3.6+?

August 22, 2022 by Magenaut

Dictionaries are insertion ordered as of Python 3.6. It is described as a CPython implementation detail rather than a language feature. The documentation states:

Categories Python, Q&A Tags dictionary, python, python-3.6, python-3.x, python-internals Leave a comment

Why is the order in dictionaries and sets arbitrary?

August 22, 2022 by Magenaut

I don’t understand how looping over a dictionary or set in python is done by ‘arbitrary’ order.

Categories Python, Q&A Tags dictionary, python, python-internals, set Leave a comment

Accessing class variables from a list comprehension in the class definition

August 22, 2022 by Magenaut

How do you access other class variables from a list comprehension within the class definition? The following works in Python 2 but fails in Python 3:

Categories Python, Q&A Tags list-comprehension, python, python-3.x, python-internals, scope Leave a comment

How does the @property decorator work in Python?

August 22, 2022 by Magenaut

I would like to understand how the built-in function property works. What confuses me is that property can also be used as a decorator, but it only takes arguments when used as a built-in function and not when used as a decorator.

Categories Python, Q&A Tags decorator, properties, python, python-decorators, python-internals Leave a comment

“is” operator behaves unexpectedly with integers

August 22, 2022 by Magenaut

Why does the following behave unexpectedly in Python?

Categories Python, Q&A Tags identity, int, operators, python, python-internals Leave a comment

Finding the source code for built-in Python functions?

August 22, 2022 by Magenaut

Is there a way to see how built in functions work in python? I don’t mean just how to use them, but also how were they built, what is the code behind sorted or enumerate etc…?

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

What is the global interpreter lock (GIL) in CPython?

August 22, 2022 by Magenaut

What is a global interpreter lock and why is it an issue?

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

Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?

August 21, 2022 by Magenaut

It is my understanding that the range() function, which is actually an object type in Python 3, generates its contents on the fly, similar to a generator.

Categories Python, Q&A Tags performance, python, python-3.x, python-internals, range Leave a comment

Usage of __slots__?

August 21, 2022 by Magenaut

What is the purpose of __slots__ in Python — especially with respect to when I would want to use it, and when not?

Categories Python, Q&A Tags oop, python, python-internals, slots Leave a comment

How is Python’s List Implemented?

August 21, 2022 by Magenaut

Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn’t good enough to look at the source code.

Categories Python, Q&A Tags arrays, linked-list, list, python, python-internals Leave a comment
Older posts
Page1 Page2 … Page5 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