Last updated: September 4, 2024 at 06:17 PM
Query: Python Coding
Sphinx and FastAPI
Linting and Type Hinting
- Use black for linting, can combine with flake8.
- Utilize type hinting with Mypy.
- Unit testing with pytest.
IDE and Library Setup
- IDE: Vim.
- Standard Python library setup includes
pyproject.toml
orsetup.py
. - Use xcookie and xdev for managing dependencies.
Recommendations and Best Practices
- Recommend against pinning versions of dependencies but set minimum versions for compatibility.
- Break up reusable components into modules.
- Use Docker for development environments.
Logging, Configurations, and Clean Code
- API docs are nice to have, but manual docs are always necessary.
- Configuration settings must be documented and consistent across projects.
- CI/CD Release/Deploy must be consistent and well-documented.
- Module and class names should be appropriate for better code readability.
Recommended Tools and Frameworks
- Package Managers: Pdm, Hatchling.
- Formatters: Ruff, black.
- Type Checkers: Mypy, Pyright.
Python Development and Tools
- Autodocs: Built from Google-style docstrings.
- Use xdev docstubs to generate *.pyi files for checking with Mypy.
- Use Commitizen for version bump and changelog generation.
Code Review and Components
- Abstract Dependencies: Declare versions to allow patch updates.
- Concrete Dependencies: Capture all packages used and hard-pin them to exact versions.
Python Coding Resources
- Use coding sites like codingame.com, codingbat.com.
- Practice coding with Python Katas from sites like Spoj.
Learning Python
- Online resources like Automate the Boring Stuff with Python are great for beginners.
- Refer to Python standard library tutorials and HowTOs for basics.
- Explore resources like Python Principles for practice-based learning.
Additional Tools and Tips
- Test regex using regex101.com.
- Building chatbots for Telegram or Whatsapp for practical experience.
- Engage in coding challenges on sites like leetcode.com or hackerrank.com.
Community Support
- Visit r/learnpython for a list of resources for beginners.
- Seek help in community forums like r/learnpython for Python assignments.
This summary provides a comprehensive overview of various tools, best practices, resources, and tips for Python coding based on Reddit comments related to the query.