Skip to content

Magenaut

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

cpython

Python string with space and without space at the end and immutability

August 15, 2022 by Magenaut

I learnt that in some immutable classes, __new__ may return an existing instance – this is what the int, str and tuple types sometimes do for small values.

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

How is tuple implemented in CPython?

August 14, 2022 by Magenaut

I’ve been trying to learn how CPython is implemented under the scenes. It’s great that Python is high level, but I don’t like treating it like a black box.

Categories Python, Q&A Tags cpython, data-structures, python, python-internals, tuples Leave a comment

How to generate a repeatable random number sequence?

August 13, 2022 by Magenaut

I would like a function that can generate a pseudo-random sequence of values, but for that sequence to be repeatable every run. The data I want has to be reasonably well randomly distributed over a given range, it doesn’t have to be perfect.

Categories Python, Q&A Tags cpython, python, random Leave a comment

Why don’t Python sets preserve insertion order?

August 13, 2022 by Magenaut

I was surprised to discover recently that while dicts are guaranteed to preserve insertion order in Python 3.7+, sets are not:

Categories Python, Q&A Tags cpython, python, set Leave a comment

Nested list comprehension scope

August 13, 2022 by Magenaut

The best way to explain my question is with an example:

Categories Python, Q&A Tags cpython, python, python-3.x, scope Leave a comment
Newer posts
← Previous Page1 Page2
  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