Head First Python, 3rd Edition by Paul Barry

Head First Python, 3rd Edition by Paul Barry

Author:Paul Barry [Paul Barry]
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2023-08-25T00:00:00+00:00


Relax

The print dir invocation produced a big list, but you only need to worry about half of it.

You can safely ignore all of the methods which start and end with the double underscore character, such as __add__ and __ne__. These are this object’s “magic methods” and they do serve a purpose, but it’s far too early in your Python journey to worry about what they do and how you can use them. Instead, concentrate on the rest of the methods on this list.

there are no Dumb Questions

Q: If those double-underscore methods are not important, why are they on the list returned by dir?

A: It’s not that they aren’t important, it’s more a case that you don’t need to concern yourself with what they do at this stage. Trust us, when you need to understand what the double-underscore methods do, we’ll tell you. Pinky-promise.

Q: Is there a way I can learn more about what a particular method does?

A: Yes, and we’ll show you how in a page or two. What’s cool is that using Jupyter makes this an especially easy thing to do.

Q: It’s all a bit of a mouthful, all this double-underscore stuff, isn’t it?

A: Yes, it is. Most Python programmers shorten “double_ underscore add double_underscore” to simply “dunder add”. So, if you hear someone refer to an method as “dunder exit”, what they are actually referring to is __exit__. All of these (as a group) are called “the dunders”. Further, any method which starts with a single-underscore is known as a “wonder” (and – yes – it is a perfectly acceptable reaction to groan at all of this).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
In-Memory Analytics with Apache Arrow by Matthew Topol(2694)
Data Forecasting and Segmentation Using Microsoft Excel by Fernando Roque(2691)
PostgreSQL 14 Administration Cookbook by Simon Riggs(2218)
Cloud Auditing Best Practices: Perform Security and IT Audits across AWS, Azure, and GCP by building effective cloud auditing plans by Shinesa Cambric Michael Ratemo(1618)
Architects of Intelligence_The Truth About AI From the People Building It by Martin Ford(1240)
In-Memory Analytics with Apache Arrow: Perform fast and efficient data analytics on both flat and hierarchical structured data by Matthew Topol(1037)
Mastering Azure Virtual Desktop: The Ultimate Guide to the Implementation and Management of Azure Virtual Desktop by Ryan Mangan(1014)
Automated Machine Learning in Action by Qingquan Song Haifeng Jin Xia Hu(903)
Python GUI Programming with Tkinter, 2nd edition by Alan D. Moore(870)
Ansible for Real-Life Automation - A complete Ansible handbook filled with practical IT automation use cases (2022) by Packt(742)
Learn Wireshark - A definitive guide to expertly analyzing protocols and troubleshooting networks using Wireshark - 2nd Edition (2022) by Packt(734)
Data Engineering with Scala and Spark by Eric Tome Rupam Bhattacharjee David Radford(417)
Introduction to Algorithms, Fourth Edition by unknow(363)
ABAP Development for SAP HANA by Unknown(359)
Automated Machine Learning in Action by Qingquan Song & Haifeng Jin & Xia Hu(304)
Kubernetes Secrets Handbook by Emmanouil Gkatziouras | 
Rom Adams
 | Chen Xi(286)
Asynchronous Programming in Rust by Carl Fredrik Samson;(259)
Learn Enough Developer Tools to Be Dangerous: Git Version Control, Command Line, and Text Editors Essentials by Michael Hartl(255)
Machine Learning for Imbalanced Data by Kumar Abhishek Dr. Mounir Abdelaziz(251)
The AWK Programming Language by Aho Alfred V. Kernighan Brian W. Weinberger Peter J. & Brian W. Kernighan & Peter J. Weinberger(241)