Skip to content

Magenaut

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

python-internals

Why do two identical lists have a different memory footprint?

August 14, 2022 by Magenaut

I created two lists l1 and l2, but each one with a different creation method:

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

Tuple or list when using ‘in’ in an ‘if’ clause?

August 14, 2022 by Magenaut

Which approach is better? Using a tuple, like:

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

Why is one class variable not defined in list comprehension but another is?

August 13, 2022 by Magenaut

I just read the answer to this question: Accessing class variables from a list comprehension in the class definition

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

How is unicode represented internally in Python?

August 13, 2022 by Magenaut

How is Unicode string literally represented in Python’s memory?

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

Is there anything faster than dict()?

August 12, 2022 by Magenaut

I need a faster way to store and access around 3GB of k:v pairs. Where k is a string or an integer and v is an np.array() that can be of different shapes.

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

Accessing dictionary items by position in Python 3.6+ efficiently

August 12, 2022 by Magenaut

I understand dictionaries are insertion ordered in Python 3.6+, as an implementation detail in 3.6 and official in 3.7+.

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

Python string literal concatenation

August 12, 2022 by Magenaut

I can create a multi-line string using this syntax:

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

Integer File Descriptor “0” in open()

August 12, 2022 by Magenaut

In Python 3, it is possible to open a file object using an “integer file descriptor” with the format:

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

How references to variables are resolved in Python

August 12, 2022 by Magenaut

This message is a a bit long with many examples, but I hope it
will help me and others to better grasp the full story of variables
and attribute lookup in Python 2.7.

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

When are .pyc files refreshed?

August 11, 2022 by Magenaut

I understand that “.pyc” files are compiled versions of the plain-text “.py” files, created at runtime to make programs run faster. However I have observed a few things:

Categories Python, Q&A Tags pyc, python, python-internals Leave a comment
Older posts
Newer posts
← Previous Page1 … Page3 Page4 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