101
18

Understanding and debugging Python data structures gets easier with memory_graph visualization. Here's a Multiway Tree example. A Multiway Tree is similar to a Binary Tree but has an arbitrary number of children making the tree less deep and more efficient.

102
14
Python Copies (lemmy.nz)

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

103
10

Though I still consider myself active, the other maintainers are... not really. We require approval from a maintainer who didn't author the PR to merge a PR, and thus 4 PRs have been collecting dust waiting for review for half a year now, including the quite critical #376 addressing more indent_namespace false positives.

While maintainers don't necessarily need to commit code, they do need to learn how the code works so they may check code quality when reviewing PRs. Some Python experience would be preferred.

104
75
105
105
submitted 10 months ago by cm0002@lemmy.zip to c/python@programming.dev

The Python Software Foundation, earlier this year, successfully obtained a $1.5 million grant from the US National Science Foundation "to address structural vulnerabilities in Python and PyPI". The actual grant came with some strings attached though, in the form of a requirement not to pursue diversity, equity, and inclusion programs. So the Foundation has withdrawn the proposal rather than agree to terms that run counter to its own mission.

We're disappointed to have been put in the position where we had to make this decision, because we believe our proposed project would offer invaluable advances to the Python and greater open source community, protecting millions of PyPI users from attempted supply-chain attacks. The proposed project would create new tools for automated proactive review of all packages uploaded to PyPI, rather than the current process of reactive-only review.

106
34
107
122
submitted 10 months ago by nemeski@mander.xyz to c/python@programming.dev
108
12
109
13

I'm looking for a way to generate a single Markdown (.md) file that includes all the file names, function definitions, and docstrings from my Python files. Ideally, this should traverse a directory recursively while respecting the .gitignore rules.

Does anyone know of a package that accomplishes this?

110
4
111
21

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

112
13
113
5
submitted 10 months ago* (last edited 10 months ago) by bterwijn@programming.dev to c/python@programming.dev

Teaching and learning Python bitwise operators gets much easier after showing the binary representations of integers using memory_graph: bitwise operators in Memory Graph Web Debugger

Understanding of the inverse ~ operator is helped by showing the two’s complement representation.

114
7
submitted 10 months ago* (last edited 10 months ago) by CoderSupreme@programming.dev to c/python@programming.dev

I have a list of communities, each with total votes, upvote percentage, and the community name. I want to sort the list by 'engagement,' which would be some combination of total votes and upvote percentage. What is the best way to do this? What would be the best measure of 'engagement' with each community given this data?

115
10
submitted 10 months ago* (last edited 10 months ago) by CoderSupreme@programming.dev to c/python@programming.dev

Hi everyone,

I’m trying to write a Python script to fetch all the communities a specific Lemmy user is subscribed to, with one community per line.

I’ve seen examples using raw requests (like this post), but I’d like to do it using Pythorhead instead.

Has anyone done this before or can provide a simple example of how to list a user’s subscriptions using Pythorhead?

Similarly, I'd also like to get the list of communities that the user has blocked.

Thanks!

116
6
117
10
Python 3.13.9 (www.python.org)
submitted 10 months ago by cm0002@lemdro.id to c/python@programming.dev
118
5
submitted 10 months ago by cx40@piefed.ca to c/python@programming.dev

I've noticed that a lot of my projects follow the same basic architecture and I often like to write some simple tools for myself where it takes much longer to set up the project than it does to write the domain specific code. So I've been looking into scaffolding tools to help with this. I'm aware of Cookiecutter and Copier. Are there others? How do they compare? What are your preferences and why?

119
23
120
16
121
14

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

122
48
submitted 10 months ago by nemeski@mander.xyz to c/python@programming.dev
123
24
124
14

Some struggle with recursion, but as package invocation_tree visualizes the Python call tree in real time, it gets easy to understand what is going on and to debug any remaining issues.

See this one-click Quick Sort demo in the Invocation Tree Web Debugger.

125
12
view more: ‹ prev next ›

Python

8019 readers
4 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 3 years ago
MODERATORS