Friday, December 3, 2021

"Mathspp Pydon'ts": Why mastering Python is impossible, and why that's ok | Pydon't 🐍

Let me tell you why it is impossible to truly master Python, but also show you how to get as close to it as possible.

A rocky trail heading up a hill.Photo by Migle Siauciulyte on Unsplash.

Introduction

It has been said that you need 10,000 hours to master a skill. I won't dispute if that's true or not. What I'll tell you is that, even if that's true, I'm not sure it applies to Python!

In this Pydon't, I'll explain why I think you can't really master Python, but I'll also tell you why I think that's ok: I'll give you a series of practical tips that you can use to make sure you keep improving your Python knowledge.

Finally, by the end of the Pydon't, I'll share a little anecdote from my own personal experience with Python, to support my claims.

You can now get your free copy of the ebook “Pydon'ts – Write beautiful Python code” on Gumroad to help support the series of “Pydon't” articles 💪.

“to master”, verb

Here's the dictionary definition of the verb “to master”:

“master”, verb – to learn or understand something completely

From my personal experience, there are two levels at which I believe one cannot master Python; I'll lay both of them down now.

Python is an evolving language

The Python language is an evolving language: it isn't a finished product. As such, it keeps growing:

  • new functions get added;
  • new syntax is introduced;
  • the standard library changes;
  • ...

Therefore, I can never know everything about it! As soon as I think I just learned all the things there are to learn, new things pop up.

This is something I believe in, but it is also almost a philosophical point of view. There is also a practical side to this argument.

Python is just too big

Not only does the language keep changing, one can argue that the Python language is already too big for you to be able to master it.

For example, most of us are familiar with the list methods .append or .pop. But, from my experience, most people aren't familiar with the list methods .copy, or .extend, for example. In fact, let's do an experiment: can you name the 11 existing list methods?

Scroll to the bottom of the page and write them down as a comment. If not the 11, write down as many as you can remember.

Here are they:

>>> [name for name in dir(list) if not name.startswith("__")]
['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']

No idea what dir is? Just scroll down.

Maybe you even knew about all of them, but being able to name them is hard, right?

Let's do a similar thing for strings! First, jot down as many string methods that you can remember.

Done?

Great. Now count them. How many did you get?

Now, how many string methods do you think there are?

There are 47 (!) string methods!

Probably, you never even heard about some...



from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...