GitShow/fireship-io/code-this-not-that-python-edition
fireship-io

code-this-not-that-python-edition

10 tips to make your code more Pythonic

by fireship-io
Star on GitHubFork

Python

25 stars8 forks2 contributorsQuiet · 2y agoSince 2022

Meet the team

See all 2 on GitHub →
tw0h4ndz
tw0h4ndz3 contributions
isocolon
isocolon1 contribution

Languages

View on GitHub →
Python100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

1 of 6 standards met

Community profile →
25
✓README○License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 3 in progress · Last activity 2y ago
See all on GitHub →
SyberiaK
"Generators" section misleads about the ability to iterate generatiors multiple timesOpenIssue

Generators are a powerful tool to save memory and improve performance. In general, they yield one value at a time and can be iterated over multiple times. That's not true. After the first go-through the generator becomes empty. Also... making this kind of generator from is kinda a wacky idea. You can just use the range itself, which also acts like a generator and saves some additional memory. And it can actually be iterated multiple times.

SyberiaK · 1y ago
Ragug
Improve Default Argument Handling in immutable_default_args.pyOpenPR

Pull Request: Fix Mutable Default Arguments in Changes Made: 1. Updated the function in for improved readability and correctness. Replaced with for a more concise and idiomatic check. Introduced the pattern to optimize the default argument assignment. Reasoning: The original implementation of the function contained a redundant condition, which has been simplified to for better clarity. Additionally, the use of provides a more concise and Pythonic way to handle default argument initialization. Testing: Verified the changes with test cases, ensuring the function behaves correctly with both specified and default arguments. Checked for any potential side effects on existing code that uses the function. Additional Notes: This update aims to enhance the clarity and maintainability of the code while preserving the intended functionality of the function. No functional changes have been introduced. Please review and merge at your earliest convenience. Thank you!

Ragug · 2y ago
Hardvan
Reformat the code using autopep8, minor improvement in logicOpenPR

Styled the code using python's autopep8 library and also added a break statement in any.py for better efficiency in the inefficient method.

Hardvan · 3y ago

Recent fixes

View closed PRs →
Algod001
Updating the incorrect outputMergedPR

getsizeof(G) bytes returns 200 (bytes) instead of 112.

Algod001 · 2y ago
isocolon
Update generators.pyMergedPR

Fix typo

isocolon · 3y ago
Structured data for AI agents

Repository: fireship-io/code-this-not-that-python-edition. Description: 10 tips to make your code more Pythonic Stars: 25, Forks: 8. Primary language: Python. Languages: Python (100%). Open PRs: 3, open issues: 1. Last activity: 2y ago. Community health: 25%. Top contributors: tw0h4ndz, isocolon.

·@ofershap

Replace github.com with gitshow.dev