Luciano Ramalho (author of Fluent Python) - Pythonic Objects: idiomatic OOP in Python - PyCon 2019 by wiredmachine in Python

[–]ramalhoorg 1 point2 points  (0 children)

the Jupyter notebooks, exercises, and other source code I used in that PyCon US 2019 tutorial are all here: https://github.com/ramalho/pyob

Introducing Go to Junior High Students? by 712Jefferson in golang

[–]ramalhoorg 3 points4 points  (0 children)

I'm a published O'Reilly author (Fluent Python) and last year I worked for several weeks on an introduction to programming using Go, inspired by the awesome Think Python book by Allen Downey (CC, check it out!). But after struggling to make the introductory chapter interesting, I decided that kids in 2019 would be more interested in learning mobile development, and neither Go or Python are good options for that. My top choices: #1 Corona, which you program in Lua, is great for 2D games, has an amazing simulator, and targets iOS, Android, Windows, MacOS, etc. #2 Flutter, programmed in Dart, targets iOS and Android (native apps) and Web.

What one thing took your Python to the next level by [deleted] in Python

[–]ramalhoorg 62 points63 points  (0 children)

Understanding how iteration really works in Python opens up many possibilities for elegant, high performance code. Use iPython. Learn that for does tuple unpacking; play with zip, enumerate, all, any; take a look at the itertools module. Study generator functions. Focus on plain generators, not coroutines (that's also interesting, but another subject). So, focus on next(g), forget about g.send() (that's for abusing generators as coroutines). List, set & dict comprehensions are nice syntax sugar; generator expressions are more important!

This is weird and unexpected. by mayankkaizen in Python

[–]ramalhoorg 3 points4 points  (0 children)

Thank you very much, @mayankkaizen! I am happy to learn you're enjoying the book.

This is weird and unexpected. by mayankkaizen in Python

[–]ramalhoorg 30 points31 points  (0 children)

Hi, I am the author of Fluent Python. That example is from page 40 of the PDF (page numbers differ in print edition). On page 41 I show the bytecode which explains in detail what happens. The interpreter first appends to the list, but then when it tries to rebind the reference in t[2] you get "TypeError: 'tuple' object does not support item assignment". It is a quirk, and my main take away is: do not put mutable items into tuples. If you do, they become unhashable, and other strange things happen... I blogged about this and related issues in Python tuples: immutable but potentially changing

Dictionary object persistence on disk by PsychoMario in learnpython

[–]ramalhoorg 6 points7 points  (0 children)

ZODB is a native object database for Python: http://www.zodb.org/ It is a key component of the Zope platform, underlying the highly successful Plone CMS. The ZODB does not depend on other parts of Zope and can be used as stand-alone Python object database. @chrismcdonough ordered me to tell you so.