@@ -277,9 +277,11 @@ inspect(10, methods=True)
277277
278278In fact there are still more methods, as you can see if you execute ` inspect(10, all=True) ` .
279279
280+
281+
280282## A Little Mystery
281283
282- In this lecture we claimed that Python is object oriented.
284+ In this lecture we claimed that Python is, at heart, an object oriented language .
283285
284286But here's an example that looks more procedural.
285287
@@ -289,13 +291,12 @@ m = len(x)
289291m
290292```
291293
292- If Python is object oriented, why don't we use ` x.len() ` ? Isn't this
293- inconsistent?
294+ If Python is object oriented, why don't we use ` x.len() ` ?
294295
295- The answers are related to the fact that Python aims for consistent style.
296+ The answer is related to the fact that Python aims for readability and consistent style.
296297
297298In Python, it is common for users to build custom objects --- we discuss how to
298- do this [ later] ( python_oop ) `.
299+ do this {doc} ` later < python_oop> ` .
299300
300301It's quite common for users to add methods to their that measure the length of
301302the object, suitably defined.
@@ -305,10 +306,10 @@ When naming such a method, natural choices are `len()` and `length()`.
305306If some users choose ` len() ` and others choose ` length() ` , then the style will
306307be inconsistent and harder to remember.
307308
308- To avoid this, the creator of Python chose to have some built-in functions
309- like ` len() ` , to make clear that ` len() ` is the convention.
309+ To avoid this, the creator of Python chose to add
310+ ` len() ` as a built-in function , to help emphasize that ` len() ` is the convention.
310311
311- Now, having said all of this, Python still is object oriented under the hood.
312+ Now, having said all of this, Python * is * still object oriented under the hood.
312313
313314In fact, the list ` x ` discussed above has a method called ` __len__() ` .
314315
@@ -341,7 +342,8 @@ This includes not just lists, strings, etc., but also less obvious things, such
341342* files opened for reading or writing
342343* integers, etc.
343344
344-
345+ Remember that everything is an object will help you interact with your programs
346+ and write clear Pythonic code.
345347
346348## Exercises
347349
0 commit comments