Op werkdagen voor 23:00 besteld, morgen in huis Gratis verzending vanaf €20

Pythonic Programming

Tips for Becoming an Idiomatic Python Programmer

Paperback Engels 2022 9781680508611
Verkooppositie 3389Hoogste positie: 3389
Verwachte levertijd ongeveer 8 werkdagen

Samenvatting

Make your good Python code even better by following proven and effective pythonic programming tips. Avoid logical errors that usually go undetected by Python linters and code formatters, such as frequent data look-ups in long lists, improper use of local and global variables, and mishandled user input. Discover rare language features, like rational numbers, set comprehensions, counters, and pickling, that may boost your productivity.

Discover how to apply general programming patterns, including caching, in your Python code. Become a better-than-average Python programmer, and develop self-documented, maintainable, easy-to-understand programs that are fast to run and hard to break. Python is one of the most popular and rapidly growing modern programming languages.

With more than 200 standard libraries and even more third-party libraries, it reaches into the software development areas as diverse as artificial intelligence, bioinformatics, natural language processing, and computer vision. Find out how to improve your understanding of the spirit of the language by using one hundred pythonic tips to make your code safer, faster, and better documented. This programming style manual is a quick reference of helpful hints and a random source of inspiration.

Choose the suitable data structures for searching and sorting jobs and become aware of how a wrong choice may cause your application to be completely ineffective. Understand global and local variables, class and instance attributes, and information-hiding techniques. Create functions with flexible interfaces.

Manage intermediate computation results by caching them in files and memory to improve performance and reliability. Polish your documentation skills to make your code easy for other programmers to understand. As a bonus, discover Easter eggs cleverly planted in the standard library by its developers.

Polish, secure, and speed-up your Python applications, and make them easier to maintain by following pythonic programming tips. What You Need:You will need a Python interpreter (ideally, version 3.4 or above) and the standard Python library that usually comes with the interpreter.

Specificaties

ISBN13:9781680508611
Trefwoorden:Programmeren, Pythonic
Taal:Engels
Bindwijze:paperback
Aantal pagina's:140
Druk:1
Verschijningsdatum:5-10-2021
Hoofdrubriek:IT-management / ICT

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Geef uw waardering

Zeer goed Goed Voldoende Matig Slecht

Inhoudsopgave

Preface
Introduction
About the Software
About the Notation
About the Reader
Documentation Tips
Hello, World!
Import This
Know Ownership and Licensing
Use Quotes of All Sorts
Keep Letter Case Consistent
Wrap Long Lines
Self-Document Your Code
Do Not Misuse Docstrings
Let input() Speak for Itself
Mark Dummy Variables
Distinguish Parameters and Arguments
Avoid ``Magic’’ Values
Enumerate Your Constants
General Tips excerpt
Chain Comparison Operators
Expand the Tabs
Pickle It
Avoid range() in Loops
Pass It
Try It
Embrace Comprehensions
Make Your Code Compact with Conditional Expressions
Find the ``Missing’’ Switch
Eschew Comprehension Expressions, If Needed
Use Slicing to Reverse and Split
sum() Almost Anything
Transpose with zip()
Discover All Characters in One Place
glob() the Files
Use Strings as Files
Pick to str() or to repr()
Remember, input() Remembers
Do Linear Algebra in Python
Data Types and Data Structures Tips excerpt
Construct a One-Element Tuple
Improve Readability with Raw Strings
Unpack Lists and Tuples
Print a List
Flatten That List
Treat Your Code as a Module
Let Modules Act Independently
Add Class Attributes
Serialize Objects
Count with defaultdict
Count with Counter
Explore How int() Supports Other Bases
Discover Complex Numbers
Rational Numbers Exist
Discover an Infinity
Carve It in Stone
No Trees? Use a dict()
Function Tips
Make Functions Always Return Something
Return Consistently
Let the Caller Print
Return Many Values
Understand Optional and Keyword Parameters
Pass Arguments Your Way
Omit Else After Return
Chain Function Calls
Yield, Do Not Return
Return and Apply Functions
Savvy Anonymous Functions
Performance Tips
Time It
Avoid Function Calls; They Are Costly
Build, Then Print
Format with Formatted Strings
Import Wisely
Import as Needed
Optimize Lookups
Cache It
Checkpoint, It Saves Time
Sort Big in Place
Delete Your Garbage
Beware of Large and Slow Ints
Waste Space, Save Time
Do Not str() a str
Safety Tips excerpt
Call That Function
Get the Hang of Local Variables
Grasp What Is Truth
Check for Range
Strip User Input
Let Python Close Your Files
Read Files Safely
Hide Everything
Use Properties
Compare One to Many
Check, Then Touch
Assert Conditions
Do Not eval(); It Is Evil
Parse with literal_eval()
Treat Variables as References
Isolate Exceptions
Compare Prefixes and Suffixes
Remember, There Are No Globals
Is Is Not What You Think It Is
Distinguish type() and isinstance()
50,000 Is Not a Number, but 50_000 Is
Do Not Confuse Boolean and Bitwise Operators
Do Not Call Your List ``List’’
Do Not Change That Loop Variable
str.split() by White Spaces
Get over str.split()
Wrapping Up

Managementboek Top 100

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        Pythonic Programming