Mostly Python

Mostly Python is a Substack focused on Python programming, offering tutorials, best practices, and insights on tools and libraries like Streamlit, pandas, and Django. It also delves into concepts like object-oriented programming, data optimization, and testing methodologies, alongside discussions on programming in the AI era and personal development through streaks.

Python Programming Data Analysis Software Development Programming Best Practices Object-Oriented Programming Application Deployment Data Visualization Software Testing Web Development Programming in the AI Era

The hottest Substack posts of Mostly Python

And their main takeaways
1257 implied HN points 29 Feb 24
  1. The author is moving their newsletter from Substack to Ghost as they feel Ghost is a better fit due to its focus on writing and its open-source foundation.
  2. It's important to consider the platform's business model when deciding on a service, as sustainable revenue streams can help avoid unwanted platform changes and dark patterns.
  3. Being able to export your data easily and understanding the platform's funding history are crucial factors to consider when choosing a service for the long term.
524 implied HN points 22 Feb 24
  1. When creating a test suite, consider the constraints of your project and think about how to handle testing for non-traditional outputs like images or sound files.
  2. Use pytest to optimize your test suite by utilizing features like parametrization, fixtures, parallel test execution, and custom CLI arguments.
  3. An effective test suite should not only focus on passing tests but also consider failure scenarios, the need for assertions about test setup, and testing across platforms early on.
314 implied HN points 07 Mar 24
  1. There are two main types of bugs - those that cause code to break and those that are logical errors, which are harder to fix as the code runs without generating a traceback.
  2. Current platforms like Substack and Ghost have limitations in displaying code blocks, lacking proper syntax highlighting and tools for pointing out specific lines.
  3. Developing utility functions to isolate and troubleshoot problematic code can make it easier to maintain and use in larger projects, ultimately saving time and effort in the long run.
Get a weekly roundup of the best Substack posts, by hacker news affinity:
524 implied HN points 06 Feb 24
  1. You can deploy Streamlit apps to Streamlit's Community Cloud hosting service with a straightforward process.
  2. Make sure to be aware of the privacy concerns when granting Streamlit permissions for GitHub repositories.
  3. Streamlit sets a web hook on the repository, so any changes pushed to the repository's main branch will automatically update the deployed project.
314 implied HN points 15 Feb 24
  1. Testing a Django project in a book involves creating a copy of the project, setting up a separate virtual environment, and ensuring it functions correctly on new Django versions.
  2. When testing a Django project, focus is usually on internal code, but the priority here is verifying functionality on new Django versions due to its frequent updates.
  3. The post discusses developing a single test function for a Django project named Learning Log, emphasizing the importance of testing project functionality as intended.
314 implied HN points 25 Jan 24
  1. The post discusses testing a game project, Alien Invasion, which may seem challenging to test at first.
  2. Testing the book's code against different versions of Python is important to identify bugs and incompatibilities.
  3. Using tools like pyenv to switch between Python versions can make testing with different versions easier.
1257 implied HN points 06 Jul 23
  1. Object-oriented programming (OOP) is important because it stores information and actions in one place.
  2. OOP is powerful for getting work done efficiently, as shown by the ease of creating and working with objects in Python.
  3. Even if you don't write classes often, understanding OOP in Python can make you a better programmer since everything in Python is an object.
628 implied HN points 29 Jun 23
  1. The post explores new Python repositories that have gained just a small number of stars, filtering out the projects with no attention.
  2. Over 300,000 Python repositories are pushed to GitHub each month, showing the challenge of getting noticed among the vast amount of projects.
  3. Projects with a few stars can still be interesting and worth exploring, like a Pygame project inspired by Factorio.
628 implied HN points 18 May 23
  1. In Python, mutable objects can change values directly, while immutable objects create new objects when values are changed.
  2. Using dictionaries to group settings allows for changes to be tracked across classes in Python.
  3. Understanding mutable and immutable objects is crucial for managing data changes in Python, ensuring consistency across classes.
524 implied HN points 25 May 23
  1. Python uses optimization for smaller integers by pointing multiple variables to the same memory address
  2. For larger integers, Python creates new objects for each variable even if they have the same value
  3. Integer values from -5 through 256 are pre-loaded at startup for efficiency reasons
419 implied HN points 14 Mar 23
  1. Programming languages may offer multiple ways to accomplish the same task for different use cases.
  2. Python emphasizes having one clear and obvious way to do things to promote readability and maintainability.
  3. Ending a while loop in Python can be done using the while statement, break statement, or a flag - each with its own unique advantages.
314 implied HN points 22 Jun 23
  1. Use the GitHub API to explore popular new Python projects and find potential projects to contribute to.
  2. Consider filtering out AI-focused projects when exploring Python repositories to discover a variety of coding projects.
  3. Pruning repositories using specific terms can help identify non-AI Python projects to work on, providing valuable learning opportunities.
314 implied HN points 11 May 23
  1. Programming in the AI era is undergoing significant changes.
  2. The future of programming lies between extremes: no programming needed with AI doing everything, and tools not being useful.
  3. AI tools have potential to democratize software development, but their effectiveness can be underestimated due to inconsistencies and non-deterministic nature.