3 Star 0 Fork 1

mirrors_PacktPublishing/Clean-Code-in-Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Clean Code in Python

Clean Code in Python

This is the code repository for Clean Code in Python, published by Packt.

Refactor your legacy code base

What is this book about?

Python is currently used in many different areas such as software construction, systems administration, and data processing. In all of these areas, experienced professionals can find examples of inefficiency, problems, and other perils, as a result of bad code. After reading this book, readers will understand these problems, and more importantly, how to correct them.

This book covers the following exciting features: Set up tools to effectively work in a development environment Explore how the magic methods of Python can help us write better code Examine the traits of Python to create advanced object-oriented design Understand removal of duplicated code using decorators and descriptors Effectively refactor code with the help of unit tests Learn to implement the SOLID principles in Python

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

Setup

Create a virtual environment, and once activated run:

make setup

This will install the common dependencies. Besides this, each chapter might have additional ones, for which another make setup will have to be run inside that particular directory.

Each chapter has its corresponding directory given by its number.

Inside each chapter directory, tests can be run by:

make test

This requires the make application installed (in Unix environments). In environments without access to the make command, the same code can be tested by running the commands on the Makefile:

python -m doctest *.py
python -m unittest *.py

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

class Point:
    def __init__(self, lat, long):
        self.lat = lat
        self.long = long

Errata

  • In Chapter 2, page 41: Add the following import in the code: from datetime import date

Following is what you need for this book: This book will appeal to team leads, software architects and senior software engineers who would like to work on their legacy systems to save cost and improve efficiency. A strong understanding of Programming is assumed.

With the following software and hardware list you can run all code files present in the book (Chapter 1-10).

Software and Hardware List

Chapter Software required Hardware required
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Python 3.7 System with 4GB RAM
10 Docker System with 4GB RAM

Related products

Get to Know the Author

Mariano Anaya is a software engineer who spends most of his time creating software with Python and mentoring fellow programmers. Mariano's main areas of interests besides Python are software architecture, functional programming, distributed systems, and speaking at conferences.

He was a speaker at Euro Python 2016 and 2017. To know more about him, you can refer to his GitHub account with the username rmariano.

His speakerdeck username is rmariano.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781788835831

MIT License Copyright (c) 2018 Packt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_PacktPublishing/Clean-Code-in-Python.git
git@gitee.com:mirrors_PacktPublishing/Clean-Code-in-Python.git
mirrors_PacktPublishing
Clean-Code-in-Python
Clean-Code-in-Python
master

搜索帮助