r/Python • • Jun 09 '20

Resource Python 3 in One Pic

Post image
4.6k Upvotes

167 comments sorted by

View all comments

613

u/[deleted] Jun 09 '20

How is this "Python 3 in One Pic"?

Let's forget about all the built-in modules.

Here are a bunch of features missing (not duplicating the other such complaint here on this page):

  • generators

  • list/dict/set comprehensions

  • f-strings

  • with statements

  • Function definitions

  • parameter passing (args, kwargs, etc)

  • Whatever it's called when you pull lists apart: first, *rest = some_list

  • list slicing

I believe I could double the length of that list without much trouble.

190

u/hughperman Jun 09 '20

"continue"

"pass"

"try/except/finally"

"assert"

Decorators

A whole load of string functionality

The entire async set of functionality

And tons more: https://docs.python.org/3/reference/index.html

52

u/[deleted] Jun 09 '20

"pass"

The real mvp making annoying IDEs shut up

12

u/Jonno_FTW hisss Jun 10 '20

There's also ...

9

u/iamtheauthor Jun 10 '20

Is it for IDE's? I thought it was syntactically required for the indentation rules, just there's something to consume at that indent level.

→ More replies (8)
→ More replies (1)

30

u/hoppla1232 Jun 09 '20

Holy shit, I never knew about first, *rest = some_list

16

u/Ph0X Jun 09 '20

Wasn't in py2 but it's useful, can be more complex too like:

a, b, *others, c = [1, 2, 3, 4, 5, 6]

With others getting [3, 4, 5]

→ More replies (2)

1

u/Aedan91 Jun 10 '20

It's like Elixir's pattern matching.

49

u/fluzz142857 Jun 09 '20

It's called "unpacking"

→ More replies (5)

66

u/[deleted] Jun 09 '20

Python 3 in one post

python3
|
|
code

46

u/[deleted] Jun 09 '20

I believe I could double the length of that list without much trouble.

I am not being a smartass, but do it. Seriously.

Speaking as a beginner to Python, I think the most apprehensive and overwhelming issue in the language (and anything, really) isn't what I know, it is what I don't know.

I realize it is impractical to make a short listing EVERYTHING with Python, but, frankly, I love the way OP has his or her guide set up as I can follow it so easily and understand it. I now recognize things further down the pipe that I will get to learn.

7

u/TravisJungroth Jun 09 '20

Check out Learn Python in Y Minutes. It’s the same idea as this picture but a hundred times better.

→ More replies (1)

9

u/redderper Jun 09 '20

After the control flow statements they just said "fuck it, too much work"

8

u/theneonkoala Jun 09 '20

Looks like its work in progress

2

u/billsil Jun 09 '20

I actually think it’s compatible as far back to python 2.4.

2

u/[deleted] Jun 09 '20

This is apparently the "Early Access" or "Alpha Release". Maybe they are going with the "DLC Available For Purchase" model.

1

u/super-porp-cola Jun 09 '20

Mostly good points but it does have list slicing, it is missing string slicing however.

1

u/SweetOnionTea Jun 09 '20

Not to mention a the set functions that make them more useful than treating it like a list or dict. Union, difference, intersection..

1

u/DeepMachineMaster Jun 09 '20

That actually would be pretty helpful if you could spare the time to do it.

1

u/shiv26196 Jun 09 '20

So is there a "Python 3 in One Pic" for real? I mean a legit one with all the libraries.

1

u/benargee Jun 10 '20

More like "Python 3 101 in One Pic"

→ More replies (8)