• Complain

Luciano Ramalho - Fluent Python

Here you can read online Luciano Ramalho - Fluent Python full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2020, publisher: OReilly Media, Inc., genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Luciano Ramalho Fluent Python
  • Book:
    Fluent Python
  • Author:
  • Publisher:
    OReilly Media, Inc.
  • Genre:
  • Year:
    2020
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Fluent Python: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Fluent Python" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Luciano Ramalho: author's other books


Who wrote Fluent Python? Find out the surname, the name of the author of the book and a list of all author's works by series.

Fluent Python — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Fluent Python" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Fluent Python

By Luciano Ramalho

Copyright 2020 Luciano Gama de Sousa Ramalho. All rights reserved.

Printed in the United States of America.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .

  • Acquisitions Editor: Amanda Quinn
  • Development Editor: Jeff Bleiel
  • Production Editor: Daniel Elfanbaum
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Rebecca Demarest
  • August 2015: First Edition
  • January 2021: Second Edition
Revision History for the Early Release
  • 2020-03-09: First release

See http://oreilly.com/catalog/errata.csp?isbn=9781491946008 for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. Fluent Python, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-492-05628-7

Dedication

Para Marta, com todo o meu amor.

Part I. Prologue
Chapter 1. The Python Data Model
A note for Early Release readers

With Early Release ebooks, you get books in their earliest formthe authors raw and unedited content as they writeso you can take advantage of these technologies long before the official release of these titles.

This will be the 1st chapter of the final book. Please note that the GitHub repo will be made active later on.

If you have comments about how we might improve the content and/or examples in this book, or if you notice missing material within this chapter, please reach out to the author at .

Guidos sense of the aesthetics of language design is amazing. Ive met many fine language designers who could build theoretically beautiful languages that no one would ever use, but Guido is one of those rare people who can build a language that is just slightly less theoretically beautiful but thereby is a joy to write programs in.

Jim Hugunin, Creator of Jython, cocreator of AspectJ, architect of the .Net DLR

One of the best qualities of Python is its consistency.After working with Python for a while, you are able to start making informed,correct guesses about features that are new to you.

However, if you learned another object-oriented language before Python,you may find it strange to use len(collection) instead of collection.len().This apparent oddity is the tip of an iceberg that, when properly understood,is the key to everything we call Pythonic.The iceberg is called the Python Data Model,and it describes the API that you can use to make your own objects play well with the most idiomatic language features.

You can think of the data model as a description of Python as a framework.It formalizes the interfaces of the building blocks of the language itself,such as sequences, iterators, functions, coroutines, classes, context managers, and so on.

When using a framework,we spend a lot of time coding methods that are called by the framework.The same happens when we leverage the Python Data Model.The Python interpreter invokes special methods to perform basic object operations,often triggered by special syntax.The special method names are always written with leading and trailing double underscores (i.e., __getitem__).For example, the syntax obj[key] is supported by the __getitem__ special method.In order to evaluate my_collection[key], the interpreter calls my_collection.__getitem__(key).

The special method names allow your objects to implement,support, and interact with fundamental language constructs such as:

  • Collections;

  • Attribute access;

  • Iteration (including asynchronous iteration using async for);

  • Operator overloading;

  • Function and method invocation;

  • String representation and formatting;

  • Asynchronous programing using await;

  • Object creation and destruction;

  • Managed contexts (including asynchronous context managers using async with).

Magic and Dunder

The term magic method is slang for special method,but how do we talk about a specific method like __getitem__?I learned to say dunder-getitem from author and teacher Steve Holden.Most experienced Pythonistas understand that shortcut.As a result, the special methods are also known as dunder methods.

Whats new in this chapter

This chapter had few changes from the first edition because it is an introduction to the Python Data Model,which is quite stable. The most significant changes are:

  • Special methods supporting asynchronous programming and other new features,added to the tables in .

  • ,including the collections.abc.Collection abstract base class introduced in Python 3.6.

Also, here and throughout this 2nd edition Ive adopted the f-string syntax introduced in Python 3.6,which is more readable and convenient than the older string formatting notations:the str.format() method and the % operator.The most common reason to use my_fmt.format() is to build the template my_fmt at runtime.That is a real need, but doesnt happen very often.

A Pythonic Card Deck

is very simple, but it demonstrates the power of implementing just two special methods, __getitem__ and __len__.

Example 1-1. A deck as a sequence of playing cards
importcollectionsCard=collections.namedtuple('Card',['rank','suit'])classFrenchDeck:ranks=[str(n)forninrange(2,11)]+list('JQKA')suits='spades diamonds clubs hearts'.split()def__init__(self):self._cards=[Card(rank,suit)forsuitinself.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Fluent Python»

Look at similar books to Fluent Python. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Fluent Python»

Discussion, reviews of the book Fluent Python and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.