diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4aef64b..e546f77 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -3,10 +3,10 @@ github: [Sean-Bradley]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: seanwasere open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username +ko_fi: sean_bradley tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: ['https://sean-bradley.medium.com/membership']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/LICENSE b/LICENSE index 75037ef..e676d93 100644 --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,12 @@ -All code, images, text, downloads and videos from +All code, images, text, videos and downloads from Repository : https://github.com/Sean-Bradley/Design-Patterns-In-Python Website : https://sbcode.net/python Book : https://www.amazon.com/dp/B08XLJ8Z2J : ASIN B08XLJ8Z2J EBook : https://www.amazon.com/dp/B08Z282SBC : ASIN B08Z282SBC -Videos : https://www.youtube.com/playlist?list=PLKWUX7aMnlEJzRvCXnwFEdk_WJDNjMDOo +YouTube : https://www.youtube.com/playlist?list=PLKWUX7aMnlEJzRvCXnwFEdk_WJDNjMDOo +Udemy : https://www.udemy.com/course/design-patterns-in-python/?referralCode=7493DBBBF97FF2B0D24D +Skillshare : https://skl.sh/34SM2Xg -Copyright (c) 2019-2021, Sean Bradley -All rights reserved. +Copyright (c) 2019-2022, Sean Bradley +All rights reserved. \ No newline at end of file diff --git a/README.md b/README.md index 2b4e1c6..1e77797 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It is supplementary to my book titled **Design Patterns In Python** (ASIN : B08X ## Course Access -There are 4 possible ways to access the video content in this course, +There are 3 possible ways to access the video content in this course, 1. Udemy : [https://www.udemy.com/course/design-patterns-in-python/?referralCode=7493DBBBF97FF2B0D24D](https://www.udemy.com/course/design-patterns-in-python/?referralCode=7493DBBBF97FF2B0D24D) - Get **Udemy Discount Coupons** at [https://sbcode.net/coupons](https://sbcode.net/coupons) @@ -27,21 +27,32 @@ There are 4 possible ways to access the video content in this course, - 30 Day Money Back Guarantee 2. YouTube Membership : [https://www.youtube.com/channel/UCmUILI2AWt2MSUgPlZwFdOg/join](https://www.youtube.com/channel/UCmUILI2AWt2MSUgPlZwFdOg/join) - Cancel Membership Anytime -3. Skillshare : [https://skl.sh/34SM2Xg](https://skl.sh/34SM2Xg) - - Certificate of Completion - - Cancel Subscription Anytime -4. Book : [https://www.amazon.com/dp/B08XLJ8Z2J](https://www.amazon.com/dp/B08XLJ8Z2J) : ASIN B08XLJ8Z2J +3. Book : [https://amzn.to/466lBN6](https://amzn.to/466lBN6) : ASIN B08XLJ8Z2J - **Book** includes FREE Video Access Codes to view videos from the official documentation website at [https://sbcode.net/python/](https://sbcode.net/python/) All the code examples in the book can be found in these pages. +--- + +**TIP** + +> [Design Patterns In python](https://www.amazon.com/dp/B08XLJ8Z2J) **(Paperback/Kindle)** includes Video Access Codes to view videos for FREE from the official documentation website at [https://sbcode.net/python/](https://sbcode.net/python/) + +--- + +**TIP** + +> Get **Udemy Discount Coupons** at [https://sbcode.net/coupons](https://sbcode.net/coupons) + +--- + ## Overview A Design Pattern is a description or template that can be repeatedly applied to a commonly recurring problem in software design. A familiarity of Design Patterns will be very useful when planning, discussing, managing and documenting your applications from now on and into the future. -Also, throughout the book, as each design pattern is discussed and demonstrated using example code, I also introduce new python coding concepts with each new design pattern. So that as you progress through the book and try out the examples, you will also get experience and familiarity with some of the finer details of programming with python. +Also, throughout the book, as each design pattern is discussed and demonstrated using example code, I also introduce new python coding concepts with each new design pattern. So that as you progress through the book and try out the examples, you will also get experience and familiarity with some finer details of programming with python. So, in this book, you will learn about these 23 Design Patterns, @@ -74,8 +85,8 @@ So, in this book, you will learn about these 23 Design Patterns, ## Pattern Types -_...Refer to Book or Videos for extra content._ +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Class Scope and Object Scope Patterns -_...Refer to Book or Videos for extra content._ +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ diff --git a/abstract_factory/README.md b/abstract_factory/README.md index 9432996..fe3f1c5 100644 --- a/abstract_factory/README.md +++ b/abstract_factory/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Abstract Factory UML Diagram @@ -36,7 +36,7 @@ python ./abstract_factory/abstract_factory_concept.py ## Abstract Factory Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Abstract Factory Example UML Diagram @@ -60,7 +60,7 @@ Your Python code may produce errors. It happens to everybody. It is hard to fore Use the `Try`, `Except` and optional `finally` keywords to manage error handling. -In the example code, if no chair or table is returned, an `Exception` error is raised and it includes a text string that can be read and written to the console. +In the example code, if no chair or table is returned, an `Exception` error is raised, and it includes a text string that can be read and written to the console. Within your code you can use the `raise` keyword to trigger Python built in exceptions or even create your own. @@ -69,9 +69,9 @@ def get_furniture(furniture): "Static get_factory method" try: if furniture in ['SmallChair', 'MediumChair', 'BigChair']: - return ChairFactory().get_chair(furniture) + return ChairFactory.get_chair(furniture) if furniture in ['SmallTable', 'MediumTable', 'BigTable']: - return TableFactory().get_table(furniture) + return TableFactory.get_table(furniture) raise Exception('No Factory Found') except Exception as _e: print(_e) @@ -97,7 +97,7 @@ The `try/except` allows the program to continue running, as can be verified by t Alternatively, if your code didn't include the `try/except` and optional `finally` statements, the Python interpreter would return the error `NameError: name 'my_var' is not defined` and the program will crash at that line. -Also note how the default Python inbuilt error starts with `NameError` . You can handle this specific error explicitly using an extra `except` keyword. +Also note how the default Python inbuilt error starts with `NameError`. You can handle this specific error explicitly using an extra `except` keyword. ``` python try: @@ -117,4 +117,4 @@ Python Errors and Exceptions : [https://docs.python.org/3/tutorial/errors.html]( ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/abstract_factory/abstract_factory_concept.py b/abstract_factory/abstract_factory_concept.py index 2cdde1b..7b6a105 100644 --- a/abstract_factory/abstract_factory_concept.py +++ b/abstract_factory/abstract_factory_concept.py @@ -22,9 +22,9 @@ def create_object(factory): "Static get_factory method" try: if factory in ['aa', 'ab', 'ac']: - return FactoryA().create_object(factory[1]) + return FactoryA.create_object(factory[1]) if factory in ['ba', 'bb', 'bc']: - return FactoryB().create_object(factory[1]) + return FactoryB.create_object(factory[1]) raise Exception('No Factory Found') except Exception as _e: print(_e) diff --git a/abstract_factory/furniture_factory.py b/abstract_factory/furniture_factory.py index efd74f8..f52fdc9 100644 --- a/abstract_factory/furniture_factory.py +++ b/abstract_factory/furniture_factory.py @@ -13,9 +13,9 @@ def get_furniture(furniture): "Static get_factory method" try: if furniture in ['SmallChair', 'MediumChair', 'BigChair']: - return ChairFactory().get_chair(furniture) + return ChairFactory.get_chair(furniture) if furniture in ['SmallTable', 'MediumTable', 'BigTable']: - return TableFactory().get_table(furniture) + return TableFactory.get_table(furniture) raise Exception('No Factory Found') except Exception as _e: print(_e) diff --git a/adapter/README.md b/adapter/README.md index 1e033bf..36a5311 100644 --- a/adapter/README.md +++ b/adapter/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Adapter UML Diagram @@ -29,7 +29,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -43,7 +43,7 @@ method B ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -143,4 +143,4 @@ When executing [/adapter/cube_a.py](/adapter/cube_a.py) you will notice that the ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/adapter/adapter_concept.py b/adapter/adapter_concept.py index 420b295..ce43edf 100644 --- a/adapter/adapter_concept.py +++ b/adapter/adapter_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Adapter Concept Sample Code" from abc import ABCMeta, abstractmethod diff --git a/bridge/README.md b/bridge/README.md index c5ee0d9..21be331 100644 --- a/bridge/README.md +++ b/bridge/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Bridge UML Diagram @@ -29,7 +29,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -43,7 +43,7 @@ c ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -121,4 +121,4 @@ PS> python ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/bridge/bridge_concept.py b/bridge/bridge_concept.py index 2fea67d..3ba44b8 100644 --- a/bridge/bridge_concept.py +++ b/bridge/bridge_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Bridge Pattern Concept Sample Code" from abc import ABCMeta, abstractmethod diff --git a/builder/README.md b/builder/README.md index 0c9fb25..1016ae9 100644 --- a/builder/README.md +++ b/builder/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Builder UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -39,7 +39,7 @@ python ./builder/builder_concept.py ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -113,4 +113,4 @@ This line, creates a list at runtime including the strings 'SmallChair', 'Medium ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/builder/builder_concept.py b/builder/builder_concept.py index cf674c8..676f3ee 100644 --- a/builder/builder_concept.py +++ b/builder/builder_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Builder Concept Sample Code" from abc import ABCMeta, abstractmethod diff --git a/chain_of_responsibility/README.md b/chain_of_responsibility/README.md index 2ddcd9b..23537c5 100644 --- a/chain_of_responsibility/README.md +++ b/chain_of_responsibility/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Chain of Responsibility UML Diagram @@ -29,7 +29,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -47,7 +47,7 @@ Finished result = -1.5 ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -111,4 +111,4 @@ See PEP-3111 : [https://www.python.org/dev/peps/pep-3111/](https://www.python.or ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/coding-conventions.md b/coding-conventions.md index 410dee4..5c8de04 100644 --- a/coding-conventions.md +++ b/coding-conventions.md @@ -21,7 +21,7 @@ You can also enter Python code directly into the Python Interactive Console by t ``` python PS> python -Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC ... +Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC ... Type "help", "copyright", "credits" or "license" for more information. >>> ``` diff --git a/command/README.md b/command/README.md index 758771d..9835591 100644 --- a/command/README.md +++ b/command/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Command Pattern UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -42,7 +42,7 @@ Executing Command 2 ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -78,4 +78,4 @@ It is just a useful construct that you will see developers use as a recommendati ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/command/command_concept.py b/command/command_concept.py index 07e0fee..e16231b 100644 --- a/command/command_concept.py +++ b/command/command_concept.py @@ -1,3 +1,4 @@ +# pylint: disable=arguments-differ "The Command Pattern Concept" from abc import ABCMeta, abstractmethod diff --git a/composite/README.md b/composite/README.md index 9e419cb..7a9f7b0 100644 --- a/composite/README.md +++ b/composite/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Composite UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -48,7 +48,7 @@ COMPOSITE_2 id:2050574298128 ## Composite Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Composite Example UML Diagram @@ -124,4 +124,4 @@ Visit [https://docs.python.org/3/reference/expressions.html#conditional-expressi ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/composite/composite_concept.py b/composite/composite_concept.py index 7d16268..b61280e 100644 --- a/composite/composite_concept.py +++ b/composite/composite_concept.py @@ -1,3 +1,4 @@ +# pylint: disable=arguments-differ "The Composite pattern concept" from abc import ABCMeta, abstractmethod diff --git a/decorator/README.md b/decorator/README.md index d43e32f..31c7f86 100644 --- a/decorator/README.md +++ b/decorator/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Builder UML Diagram @@ -37,7 +37,7 @@ Decorator Method(Component Method) ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -133,4 +133,4 @@ The `__str__` dunder was also overridden in the [/prototype/prototype_concept.py ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/decorator/decorator_concept.py b/decorator/decorator_concept.py index 7bb2708..617add5 100644 --- a/decorator/decorator_concept.py +++ b/decorator/decorator_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Decorator Concept Sample Code" from abc import ABCMeta, abstractmethod diff --git a/facade/README.md b/facade/README.md index 90cdb6f..242a2d6 100644 --- a/facade/README.md +++ b/facade/README.md @@ -17,7 +17,7 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Facade UML Diagram @@ -37,7 +37,7 @@ B ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -170,4 +170,4 @@ Found 2 errors in 2 files (checked 1 source file) ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/factory/README.md b/factory/README.md index 5f2d0da..4a6f2b9 100644 --- a/factory/README.md +++ b/factory/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Factory UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -39,7 +39,7 @@ ConcreteProductB ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Factory Example UML Diagram @@ -93,4 +93,4 @@ See PEP 3119 : [https://www.python.org/dev/peps/pep-3119/](https://www.python.or ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/factory/client.py b/factory/client.py index 0a93224..c4f9bc5 100644 --- a/factory/client.py +++ b/factory/client.py @@ -3,5 +3,5 @@ from chair_factory import ChairFactory # The Client -CHAIR = ChairFactory().get_chair("SmallChair") +CHAIR = ChairFactory.get_chair("SmallChair") print(CHAIR.get_dimensions()) diff --git a/factory/factory_concept.py b/factory/factory_concept.py index 0c17e2a..6dbb529 100644 --- a/factory/factory_concept.py +++ b/factory/factory_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "The Factory Concept" from abc import ABCMeta, abstractmethod @@ -58,5 +59,5 @@ def create_object(some_property): # The Client -PRODUCT = Creator().create_object('b') +PRODUCT = Creator.create_object('b') print(PRODUCT.name) diff --git a/flyweight/README.md b/flyweight/README.md index ed2ffda..e0fbbc2 100644 --- a/flyweight/README.md +++ b/flyweight/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Flyweight UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -41,7 +41,7 @@ FlyweightFactory has 5 flyweights ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -86,4 +86,4 @@ eg, ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/flyweight/flyweight.py b/flyweight/flyweight.py index 63667e3..e7e33de 100644 --- a/flyweight/flyweight.py +++ b/flyweight/flyweight.py @@ -4,5 +4,5 @@ class Flyweight(): # pylint: disable=too-few-public-methods "The Flyweight that contains an intrinsic value called code" - def __init__(self, code: int) -> None: + def __init__(self, code: str) -> None: self.code = code diff --git a/flyweight/flyweight_concept.py b/flyweight/flyweight_concept.py index 85508a3..daa478f 100644 --- a/flyweight/flyweight_concept.py +++ b/flyweight/flyweight_concept.py @@ -9,21 +9,21 @@ class IFlyweight(): class Flyweight(IFlyweight): "The Concrete Flyweight" - def __init__(self, code: int) -> None: + def __init__(self, code: str) -> None: self.code = code class FlyweightFactory(): "Creating the FlyweightFactory as a singleton" - _flyweights: dict[int, Flyweight] = {} # Python 3.9 + _flyweights: dict[str, Flyweight] = {} # Python 3.9 # _flyweights = {} # Python 3.8 or earlier def __new__(cls): return cls @classmethod - def get_flyweight(cls, code: int) -> Flyweight: + def get_flyweight(cls, code: str) -> Flyweight: "A static method to get a flyweight based on a code" if not code in cls._flyweights: cls._flyweights[code] = Flyweight(code) diff --git a/flyweight/flyweight_factory.py b/flyweight/flyweight_factory.py index d2c1491..9206d38 100644 --- a/flyweight/flyweight_factory.py +++ b/flyweight/flyweight_factory.py @@ -5,14 +5,14 @@ class FlyweightFactory(): "Creating the FlyweightFactory as a singleton" - _flyweights: dict[int, Flyweight] = {} # Python 3.9 + _flyweights: dict[str, Flyweight] = {} # Python 3.9 # _flyweights = {} # Python 3.8 or earlier def __new__(cls): return cls @classmethod - def get_flyweight(cls, code: int) -> Flyweight: + def get_flyweight(cls, code: str) -> Flyweight: "A static method to get a flyweight based on a code" if not code in cls._flyweights: cls._flyweights[code] = Flyweight(code) diff --git a/img/design_patterns_in_python_book_125x178.jpg b/img/design_patterns_in_python_book_125x178.jpg index a9e180f..0cf8aaa 100644 Binary files a/img/design_patterns_in_python_book_125x178.jpg and b/img/design_patterns_in_python_book_125x178.jpg differ diff --git a/img/dp_python_125.gif b/img/dp_python_125.gif index 7e6907b..601a5b3 100644 Binary files a/img/dp_python_125.gif and b/img/dp_python_125.gif differ diff --git a/img/dp_python_250.jpg b/img/dp_python_250.jpg index 93e2230..2305ab0 100644 Binary files a/img/dp_python_250.jpg and b/img/dp_python_250.jpg differ diff --git a/img/dp_typescript_250.jpg b/img/dp_typescript_250.jpg new file mode 100644 index 0000000..ccb35c1 Binary files /dev/null and b/img/dp_typescript_250.jpg differ diff --git a/img/udemy_btn_sm.gif b/img/udemy_btn_sm.gif index 03abf37..bab7b91 100644 Binary files a/img/udemy_btn_sm.gif and b/img/udemy_btn_sm.gif differ diff --git a/interpreter/README.md b/interpreter/README.md index 444cb18..c49e7d8 100644 --- a/interpreter/README.md +++ b/interpreter/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Interpreter UML Diagram @@ -29,7 +29,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -43,7 +43,7 @@ python ./interpreter/interpreter_concept.py ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ![Abstract Syntax Tree Example](/img/interpreter_ast_roman_numeral.svg) @@ -171,4 +171,4 @@ Outputs ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/interpreter/interpreter_concept.py b/interpreter/interpreter_concept.py index 7b2bc8b..8439db5 100644 --- a/interpreter/interpreter_concept.py +++ b/interpreter/interpreter_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "The Interpreter Pattern Concept" @@ -7,7 +8,7 @@ class AbstractExpression(): @staticmethod def interpret(): """ - The `interpret` method gets called recursively for each + The `interpret` method gets called recursively for each AbstractExpression """ diff --git a/iterator/README.md b/iterator/README.md index faa5d1a..c995307 100644 --- a/iterator/README.md +++ b/iterator/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Iterator UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -42,7 +42,7 @@ This method has been invoked ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -118,4 +118,4 @@ Also note that the list being printed at the end is automatically filled from th ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/iterator/iterator_concept.py b/iterator/iterator_concept.py index 47cb1f3..59ff128 100644 --- a/iterator/iterator_concept.py +++ b/iterator/iterator_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "The Iterator Pattern Concept" from abc import ABCMeta, abstractmethod diff --git a/mediator/README.md b/mediator/README.md index e61a680..c62667a 100644 --- a/mediator/README.md +++ b/mediator/README.md @@ -15,11 +15,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Mediator UML Diagram @@ -27,7 +27,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -39,7 +39,7 @@ COLLEAGUE2 <--> Here is the Colleague1 specific data you asked for ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -62,4 +62,4 @@ Component1: <<< In <<< : data C ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/memento/README.md b/memento/README.md index 56214e0..98e5fe7 100644 --- a/memento/README.md +++ b/memento/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Memento UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ### Output @@ -53,7 +53,7 @@ State #3 ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -151,4 +151,4 @@ print(example.value) # now raises an AttributeError ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/observer/README.md b/observer/README.md index 8dbbecf..1965ab3 100644 --- a/observer/README.md +++ b/observer/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Observer UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -41,7 +41,7 @@ Observer id:2084220160272 received ('Second Notification', {'A': 1, 'B': 2, 'C': ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -88,4 +88,4 @@ Note, if instantiating an empty **Set** then use `my_object = Set()` rather than ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/observer/observer_concept.py b/observer/observer_concept.py index 5720694..1c29aa3 100644 --- a/observer/observer_concept.py +++ b/observer/observer_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Observer Design Pattern Concept" from abc import ABCMeta, abstractmethod diff --git a/prototype/README.md b/prototype/README.md index 069acd9..0b69ff8 100644 --- a/prototype/README.md +++ b/prototype/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Prototype UML Diagram @@ -28,8 +28,8 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/prototype/prototype_concept.py b/prototype/prototype_concept.py index a1c0ef8..3c82b1b 100644 --- a/prototype/prototype_concept.py +++ b/prototype/prototype_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "Prototype Concept Sample Code" from abc import ABCMeta, abstractmethod diff --git a/proxy/README.md b/proxy/README.md index 693ced3..64456cf 100644 --- a/proxy/README.md +++ b/proxy/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Proxy UML Diagram @@ -40,7 +40,7 @@ pulling data from Proxy cache ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -101,4 +101,4 @@ See the [Lion](/proxy/lion.py), [Serpent](/proxy/serpent.py) and [Leopard](/prox ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/proxy/proxy_concept.py b/proxy/proxy_concept.py index e7ff9ff..bdbe2f9 100644 --- a/proxy/proxy_concept.py +++ b/proxy/proxy_concept.py @@ -1,8 +1,10 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "A Proxy Concept Example" from abc import ABCMeta, abstractmethod + class ISubject(metaclass=ABCMeta): "An interface implemented by both the Proxy and Real Subject" @staticmethod @@ -10,6 +12,7 @@ class ISubject(metaclass=ABCMeta): def request(): "A method to implement" + class RealSubject(ISubject): "The actual real object that the proxy is representing" @@ -20,6 +23,7 @@ def __init__(self): def request(self): return self.enormous_data + class Proxy(ISubject): """ The proxy. In this case the proxy will act as a cache for @@ -36,13 +40,14 @@ def request(self): Using the proxy as a cache, and loading data into it only if it is needed """ - if self.enormous_data == []: + if not self.enormous_data: print("pulling data from RealSubject") self.enormous_data = self.real_subject.request() return self.enormous_data print("pulling data from Proxy cache") return self.enormous_data + # The Client SUBJECT = Proxy() # use SUBJECT @@ -50,4 +55,4 @@ def request(self): # load the enormous amounts of data because now we want to show it. print(SUBJECT.request()) # show the data again, but this time it retrieves it from the local cache -print(SUBJECT.request()) \ No newline at end of file +print(SUBJECT.request()) diff --git a/singleton/README.md b/singleton/README.md index 92164e1..c2cebd3 100644 --- a/singleton/README.md +++ b/singleton/README.md @@ -16,7 +16,7 @@ Cover | Links | ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Singleton UML Diagram @@ -32,11 +32,11 @@ id(OBJECT2) = 2164775087968 id(OBJECT3) = 2164775087968 ``` -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Example UML Diagram @@ -133,4 +133,4 @@ PS> python ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/singleton/singleton_concept.py b/singleton/singleton_concept.py index 0942a30..1d9d869 100644 --- a/singleton/singleton_concept.py +++ b/singleton/singleton_concept.py @@ -2,6 +2,7 @@ "Singleton Concept Sample Code" import copy + class Singleton(): "The Singleton Class" value = [] @@ -21,6 +22,7 @@ def class_method(cls): "Use @classmethod to access class level variables" print(cls.value) + # The Client # All uses of singleton point to the same memory address (id) print(f"id(Singleton)\t= {id(Singleton)}") @@ -32,4 +34,4 @@ def class_method(cls): print(f"id(OBJECT2)\t= {id(OBJECT2)}") OBJECT3 = Singleton() -print(f"id(OBJECT1)\t= {id(OBJECT3)}") \ No newline at end of file +print(f"id(OBJECT1)\t= {id(OBJECT3)}") diff --git a/state/README.md b/state/README.md index 436853d..4f1fce5 100644 --- a/state/README.md +++ b/state/README.md @@ -16,11 +16,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## State UML Diagram @@ -28,7 +28,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ### Output @@ -43,7 +43,7 @@ I am ConcreteStateC ## State Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## State Example Use Case UML Diagram @@ -92,4 +92,4 @@ EXAMPLE() # function now gets called by default ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/strategy/README.md b/strategy/README.md index a0dcbb4..8f1a389 100644 --- a/strategy/README.md +++ b/strategy/README.md @@ -15,11 +15,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Strategy UML Diagram @@ -27,7 +27,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -40,7 +40,7 @@ I am ConcreteStrategyC ## Strategy Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Strategy Example Use Case UML Diagram @@ -57,4 +57,4 @@ I am Crawling. New position = [3.5, 0] ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/template/README.md b/template/README.md index 8b3e0b3..fe00545 100644 --- a/template/README.md +++ b/template/README.md @@ -15,11 +15,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Template Method UML Diagram @@ -27,7 +27,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -42,7 +42,7 @@ Class_B : Step Three. (overridden) ## Template Method Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Template Method Use Case UML Diagram @@ -76,4 +76,4 @@ footer : -- Page 1 -- ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/visitor/README.md b/visitor/README.md index bb6e27f..1f969de 100644 --- a/visitor/README.md +++ b/visitor/README.md @@ -17,11 +17,11 @@ Cover | Links ## Overview -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Terminology -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Visitor UML Diagram @@ -29,7 +29,7 @@ Cover | Links ## Source Code -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Output @@ -44,7 +44,7 @@ A ## Visitor Example Use Case -*...Refer to Book or Videos for extra content.* +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ ## Visitor Example UML Diagram @@ -141,4 +141,4 @@ jklmn 1011 ## Summary -*...Refer to Book or Videos for extra content.* \ No newline at end of file +_... Refer to [Book](https://amzn.to/466lBN6) or [Design Patterns In Python website](https://sbcode.net/python/) to read textual content._ \ No newline at end of file diff --git a/visitor/client.py b/visitor/client.py index 5fe14d0..293cd4a 100644 --- a/visitor/client.py +++ b/visitor/client.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "The Visitor Pattern Use Case Example" from abc import ABCMeta, abstractmethod diff --git a/visitor/visitor_concept.py b/visitor/visitor_concept.py index 2fdf969..f3c33fb 100644 --- a/visitor/visitor_concept.py +++ b/visitor/visitor_concept.py @@ -1,4 +1,5 @@ # pylint: disable=too-few-public-methods +# pylint: disable=arguments-differ "The Visitor Pattern Concept" from abc import ABCMeta, abstractmethod