From 3f1801185ff2c40354bc2ed4220319e11ba8c922 Mon Sep 17 00:00:00 2001 From: Henrique Tsuyoshi Yara Date: Sun, 23 Jan 2022 17:59:29 -0300 Subject: [PATCH 01/11] Change some typos, words and improve reading (#56) * style(test_generators.py): change i for _ in loop * style(test_multiple_inheritance.py): better identation * style(test_function_arbitraty_arguments.py): fix typo * style(test_class_and_instance_variables.py): fix comment * style(test_class_and_instance_variables.py): fix typo Co-authored-by: Oleksii Trekhleb --- src/additions/test_generators.py | 2 +- src/classes/test_class_and_instance_variables.py | 2 +- src/classes/test_multiple_inheritance.py | 4 ++-- src/functions/test_function_arbitrary_arguments.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/additions/test_generators.py b/src/additions/test_generators.py index ff3bce26..6b2f2736 100644 --- a/src/additions/test_generators.py +++ b/src/additions/test_generators.py @@ -23,7 +23,7 @@ def lottery(): """ # returns first 3 random numbers between 1 and 10 # pylint: disable=unused-variable - for i in range(3): + for _ in range(3): yield random.randint(1, 10) # returns a 4th number between 10 and 20 diff --git a/src/classes/test_class_and_instance_variables.py b/src/classes/test_class_and_instance_variables.py index c4004d79..d33ff2e6 100644 --- a/src/classes/test_class_and_instance_variables.py +++ b/src/classes/test_class_and_instance_variables.py @@ -72,7 +72,7 @@ def __init__(self, name): def add_trick(self, trick): """Add trick to the dog - This function illustrate mistaken use of mutable class variable tricks (see below). + This function illustrate a correct use of mutable class variable tricks (see below). """ self.tricks.append(trick) diff --git a/src/classes/test_multiple_inheritance.py b/src/classes/test_multiple_inheritance.py index 2ad73f8d..e3d41529 100644 --- a/src/classes/test_multiple_inheritance.py +++ b/src/classes/test_multiple_inheritance.py @@ -41,8 +41,8 @@ def get_date(self): class CalendarClock(Clock, Calendar): """Class that uses multiple inheritance. - For most purposes, in the simplest cases, you can think of the search for attributes i - nherited from a parent class as depth-first, left-to-right, not searching twice in the same + For most purposes, in the simplest cases, you can think of the search for attributes + inherited from a parent class as depth-first, left-to-right, not searching twice in the same class where there is an overlap in the hierarchy. Thus, if an attribute is not found in CalendarClock, it is searched for in Clock, then (recursively) in the base classes of Clock, and if it was not found there, it was searched for in Calendar, and so on. diff --git a/src/functions/test_function_arbitrary_arguments.py b/src/functions/test_function_arbitrary_arguments.py index b3f36627..6853a178 100644 --- a/src/functions/test_function_arbitrary_arguments.py +++ b/src/functions/test_function_arbitrary_arguments.py @@ -16,7 +16,7 @@ def test_function_arbitrary_arguments(): # containing the positional arguments beyond the formal parameter list. # (*name must occur before **name.) For example, if we define a function like this: def test_function(first_param, *arguments): - """This function accepts its arguments through "arguments" tuple amd keywords dictionary.""" + """This function accepts its arguments through "arguments" tuple and keywords dictionary.""" assert first_param == 'first param' assert arguments == ('second param', 'third param') From 6ff6be8e0d825c1dc06056df92f25a6903ce2dd8 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Mon, 24 Jan 2022 05:01:18 +0800 Subject: [PATCH 02/11] fix typo "amd" -> "and" (#61) Co-authored-by: Oleksii Trekhleb --- src/functions/test_function_keyword_arguments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/test_function_keyword_arguments.py b/src/functions/test_function_keyword_arguments.py index 65d066c1..7b6ff1c3 100644 --- a/src/functions/test_function_keyword_arguments.py +++ b/src/functions/test_function_keyword_arguments.py @@ -102,7 +102,7 @@ def function_with_one_argument(number): # containing the positional arguments beyond the formal parameter list. # (*name must occur before **name.) For example, if we define a function like this: def test_function(first_param, *arguments, **keywords): - """This function accepts its arguments through "arguments" tuple amd keywords dictionary.""" + """This function accepts its arguments through "arguments" tuple and keywords dictionary.""" assert first_param == 'first param' assert arguments == ('second param', 'third param') assert keywords == { From 5e936a75c3ba15ddc4db055f161a814b6d77dcd7 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Mon, 24 Jan 2022 05:02:08 +0800 Subject: [PATCH 03/11] no **keywords dictionary parameters (#62) Co-authored-by: Oleksii Trekhleb --- src/functions/test_function_arbitrary_arguments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/test_function_arbitrary_arguments.py b/src/functions/test_function_arbitrary_arguments.py index 6853a178..2b00d176 100644 --- a/src/functions/test_function_arbitrary_arguments.py +++ b/src/functions/test_function_arbitrary_arguments.py @@ -16,7 +16,7 @@ def test_function_arbitrary_arguments(): # containing the positional arguments beyond the formal parameter list. # (*name must occur before **name.) For example, if we define a function like this: def test_function(first_param, *arguments): - """This function accepts its arguments through "arguments" tuple and keywords dictionary.""" + """This function accepts its arguments through "arguments" tuple""" assert first_param == 'first param' assert arguments == ('second param', 'third param') From 212ca88fa170a0b89f625b4f40c9734a93d43cc0 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sat, 12 Mar 2022 17:44:14 +0100 Subject: [PATCH 04/11] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index af3242d5..edb4d6dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Playground and Cheatsheet for Learning Python +> πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://twitter.com/MFA_Ukraine) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. +> - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) +> - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate/) fund [![Build Status](https://travis-ci.org/trekhleb/learn-python.svg?branch=master)](https://travis-ci.org/trekhleb/learn-python) From 28da1e44d02d489631903612479d14d910532317 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sat, 12 Mar 2022 17:46:46 +0100 Subject: [PATCH 05/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index edb4d6dd..16301256 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ > πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://twitter.com/MFA_Ukraine) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. > - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) > - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate/) fund +> - More info on [war.ukraine.ua](https://war.ukraine.ua/) [![Build Status](https://travis-ci.org/trekhleb/learn-python.svg?branch=master)](https://travis-ci.org/trekhleb/learn-python) From 756fbfefb54d0c5f0e848a0ccfc3bb05f6a83ef8 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sat, 2 Jul 2022 17:50:47 +0200 Subject: [PATCH 06/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16301256..ed382170 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Playground and Cheatsheet for Learning Python > πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://twitter.com/MFA_Ukraine) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. > - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) -> - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate/) fund +> - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate-en/) fund > - More info on [war.ukraine.ua](https://war.ukraine.ua/) [![Build Status](https://travis-ci.org/trekhleb/learn-python.svg?branch=master)](https://travis-ci.org/trekhleb/learn-python) From 684b6e1072519e73f7aa4d42f98ece4cabb1efe8 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Wed, 21 Sep 2022 09:11:01 +0200 Subject: [PATCH 07/11] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed382170..b183acab 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Playground and Cheatsheet for Learning Python -> πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://twitter.com/MFA_Ukraine) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. + +> πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://war.ukraine.ua/) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. > - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) > - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate-en/) fund -> - More info on [war.ukraine.ua](https://war.ukraine.ua/) +> - More info on [war.ukraine.ua](https://war.ukraine.ua/) and [MFA of Ukraine](https://twitter.com/MFA_Ukraine) [![Build Status](https://travis-ci.org/trekhleb/learn-python.svg?branch=master)](https://travis-ci.org/trekhleb/learn-python) From 4242402e7d4eed57d997cd764566409c65c7787c Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Wed, 21 Sep 2022 09:13:28 +0200 Subject: [PATCH 08/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b183acab..40701a3d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ > - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate-en/) fund > - More info on [war.ukraine.ua](https://war.ukraine.ua/) and [MFA of Ukraine](https://twitter.com/MFA_Ukraine) +
+ [![Build Status](https://travis-ci.org/trekhleb/learn-python.svg?branch=master)](https://travis-ci.org/trekhleb/learn-python) > This is a collection of Python scripts that are split by [topics](#table-of-contents) and contain From 72fa79eaa66d0bbb3487ce65194b5ea2eaea2e41 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Fri, 21 Oct 2022 22:23:13 +0200 Subject: [PATCH 09/11] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 40701a3d..862e42fe 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ Each Python script in this repository has the following structure: ```python """Lists <--- Name of the topic here +## Author + +- [@trekhleb](https://trekhleb.dev) + # @see: https://www.learnpython.org/en/Lists <-- Link to further readings goes here Here might go more detailed explanation of the current topic (i.e. general info about Lists). From 8344a56dacfef5405cf491bfc0eb3337500a0d56 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Fri, 21 Oct 2022 22:24:27 +0200 Subject: [PATCH 10/11] Update README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 862e42fe..2ea49895 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,6 @@ Each Python script in this repository has the following structure: ```python """Lists <--- Name of the topic here -## Author - -- [@trekhleb](https://trekhleb.dev) - # @see: https://www.learnpython.org/en/Lists <-- Link to further readings goes here Here might go more detailed explanation of the current topic (i.e. general info about Lists). @@ -228,6 +224,6 @@ flake8 ./src --statistics --show-source --count [More about Flake8](http://flake8.pycqa.org/en/latest/) -## Supporting the project +## Author -You may support this project via ❀️️ [GitHub](https://github.com/sponsors/trekhleb) or ❀️️ [Patreon](https://www.patreon.com/trekhleb). +- [@trekhleb](https://trekhleb.dev) From 52c3a655cc2efd5ac01004f6f529c3262812a84e Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Fri, 21 Jul 2023 20:09:00 +0200 Subject: [PATCH 11/11] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ea49895..f53cdf8f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Playground and Cheatsheet for Learning Python > πŸ‡ΊπŸ‡¦ UKRAINE [IS BEING ATTACKED](https://war.ukraine.ua/) BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED. -> - Help Ukraine via [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) -> - Help Ukraine via [SaveLife](https://savelife.in.ua/en/donate-en/) fund +> - Help Ukraine via: +> - [Serhiy Prytula Charity Foundation](https://prytulafoundation.org/en/) +> - [Come Back Alive Charity Foundation](https://savelife.in.ua/en/donate-en/) +> - [National Bank of Ukraine](https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi) > - More info on [war.ukraine.ua](https://war.ukraine.ua/) and [MFA of Ukraine](https://twitter.com/MFA_Ukraine)