From 2b0b26caecd3448922d2241ff1bcb85668fe9d43 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Mon, 7 Jul 2025 07:46:14 +0300 Subject: [PATCH] Fix misuse of junior and similar words --- examples/A03_comments/01_single_line_comments.py | 2 +- examples/A03_comments/02_multi_line_comments.py | 2 +- .../A11_exceptions/02_program_flow_without_try_except.py | 2 +- examples/A11_exceptions/05_catching_multiple_exceptions.py | 2 +- examples/A18_coroutines/1_decorate.py | 2 +- examples/A18_coroutines/4_pipeline.py | 2 +- examples/A18_coroutines/5_fsm.py | 4 ++-- examples/A18_coroutines/coroutine_execution.py | 6 +++--- examples/A18_coroutines/coroutine_interface.py | 4 ++-- examples/A21_meta_classes/demo_basic.py | 6 +++--- examples/A21_meta_classes/demo_declarative_api.py | 2 +- examples/A22_optimization/peephole_membership.py | 2 +- examples/A22_optimization/string_interning.py | 4 ++-- examples/B02_solid_principles/03_bad_open_closed.py | 2 +- examples/B02_solid_principles/05_bad_liskov_subsitution.py | 2 +- .../B02_solid_principles/10_good_dependency_inversion.py | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/A03_comments/01_single_line_comments.py b/examples/A03_comments/01_single_line_comments.py index b0cac18..ee51093 100644 --- a/examples/A03_comments/01_single_line_comments.py +++ b/examples/A03_comments/01_single_line_comments.py @@ -2,6 +2,6 @@ # ------------------------------------------------------------------------------ # A single-line comment in Python starts with a hash symbol (#). -# This code will print junior message and the sum of two numbers +# This code will print a message and the sum of two numbers print("Hello world!") print(1 + 1) diff --git a/examples/A03_comments/02_multi_line_comments.py b/examples/A03_comments/02_multi_line_comments.py index c75e438..a1f172f 100644 --- a/examples/A03_comments/02_multi_line_comments.py +++ b/examples/A03_comments/02_multi_line_comments.py @@ -3,7 +3,7 @@ # Multi-line comments in Python can be created using triple quotes. """ -This is junior multi-line comment. +This is a multi-line comment. The following code will print the message `Hello, world!` and then print the sum of two numbers. diff --git a/examples/A11_exceptions/02_program_flow_without_try_except.py b/examples/A11_exceptions/02_program_flow_without_try_except.py index 5c9f977..e20c2b5 100644 --- a/examples/A11_exceptions/02_program_flow_without_try_except.py +++ b/examples/A11_exceptions/02_program_flow_without_try_except.py @@ -22,7 +22,7 @@ def func_b(x): def app(value): - # Each function must have junior check of the error condition + # Each function must have a check of the error condition # as there is no standard definition of an error # Check A diff --git a/examples/A11_exceptions/05_catching_multiple_exceptions.py b/examples/A11_exceptions/05_catching_multiple_exceptions.py index 9eb1ebd..2be4512 100644 --- a/examples/A11_exceptions/05_catching_multiple_exceptions.py +++ b/examples/A11_exceptions/05_catching_multiple_exceptions.py @@ -16,7 +16,7 @@ def main(): except SocketError as e: print(e) - # Example 2: Handling junior group of exceptions with junior single except block + # Example 2: Handling a group of exceptions with a single except block try: raise DisconnectError('Connection failed', 100) diff --git a/examples/A18_coroutines/1_decorate.py b/examples/A18_coroutines/1_decorate.py index dfa98b7..19a0e7c 100644 --- a/examples/A18_coroutines/1_decorate.py +++ b/examples/A18_coroutines/1_decorate.py @@ -37,7 +37,7 @@ def sink(): print("Done with printing!") -sentence = "Bob is running behind junior fast moving car" +sentence = "Bob is running behind a fast moving car" source(text=sentence, target=pattern_filter( target=sink() diff --git a/examples/A18_coroutines/4_pipeline.py b/examples/A18_coroutines/4_pipeline.py index 8ba1b4a..f10dd78 100644 --- a/examples/A18_coroutines/4_pipeline.py +++ b/examples/A18_coroutines/4_pipeline.py @@ -35,5 +35,5 @@ def consumer(): next(filterer) # Define token splitter (producer) -sentence = "Bob is running behind junior fast moving car" +sentence = "Bob is running behind a fast moving car" producer(string=sentence, next_coroutine=filterer) diff --git a/examples/A18_coroutines/5_fsm.py b/examples/A18_coroutines/5_fsm.py index 703fee3..4463fb6 100644 --- a/examples/A18_coroutines/5_fsm.py +++ b/examples/A18_coroutines/5_fsm.py @@ -38,7 +38,7 @@ def match(self, text): # Read character and send it to the current state for char in text: - # Current state reacts to input and makes transition to junior new state + # Current state reacts to input and makes transition to a new state self.current_state.send(char) # Activate the new state @@ -56,7 +56,7 @@ def start(self): self.output = False while True: char = yield - if char == 'junior': + if char == 'a': self.current_state = self.q1() else: break diff --git a/examples/A18_coroutines/coroutine_execution.py b/examples/A18_coroutines/coroutine_execution.py index 62629b9..a22bbb1 100644 --- a/examples/A18_coroutines/coroutine_execution.py +++ b/examples/A18_coroutines/coroutine_execution.py @@ -11,13 +11,13 @@ def coroutine(): cr = coroutine() -# First usage of next to activate the coroutine and generate junior default value +# First usage of next to activate the coroutine and generate a default value print("Coroutine оutput : {0}".format(next(cr))) -# Second usage of next to generate junior new value +# Second usage of next to generate a new value print("Coroutine оutput : {0}".format(next(cr))) -# Send data to the coroutine and generate junior new value +# Send data to the coroutine and generate a new value print("Coroutine оutput : {0}".format(cr.send("abc"))) # Output: diff --git a/examples/A18_coroutines/coroutine_interface.py b/examples/A18_coroutines/coroutine_interface.py index c3fa51c..fe72d67 100644 --- a/examples/A18_coroutines/coroutine_interface.py +++ b/examples/A18_coroutines/coroutine_interface.py @@ -41,9 +41,9 @@ def letter_generator(text): # Output # ---------------------- # Started -# junior +# a # b -# junior +# a # b # Value error on position = 1 # b diff --git a/examples/A21_meta_classes/demo_basic.py b/examples/A21_meta_classes/demo_basic.py index 95c3731..e924d7a 100644 --- a/examples/A21_meta_classes/demo_basic.py +++ b/examples/A21_meta_classes/demo_basic.py @@ -9,17 +9,17 @@ def __init__(cls, name, bases, namespace): # Print the methods and attributes found at the parsing stage print(name, bases, namespace) - # Create a method called uses_metaclass returning junior simple string object + # Create a method called uses_metaclass returning a simple string object cls.uses_metaclass = lambda self: 'Added by the meta-class' class Simple1(object, with_metaclass(SimpleMeta1)): - # Add junior instance method to the namespace + # Add an instance method to the namespace def foo(self): pass - # Add junior static function to the namespace + # Add a static function to the namespace @staticmethod def bar(): pass diff --git a/examples/A21_meta_classes/demo_declarative_api.py b/examples/A21_meta_classes/demo_declarative_api.py index adbc915..01866e4 100644 --- a/examples/A21_meta_classes/demo_declarative_api.py +++ b/examples/A21_meta_classes/demo_declarative_api.py @@ -97,7 +97,7 @@ class MyClass(with_metaclass(MyMeta)): d = 'Field' in globals() def __str__(self): - """Showing the memory address of self (proving it is junior singleton).""" + """Showing the memory address of self (proving it is a singleton).""" return "I'm located at: {}".format(id(self)) diff --git a/examples/A22_optimization/peephole_membership.py b/examples/A22_optimization/peephole_membership.py index c413379..c720cdf 100644 --- a/examples/A22_optimization/peephole_membership.py +++ b/examples/A22_optimization/peephole_membership.py @@ -25,4 +25,4 @@ def peephole_membership(name): # (None, 'John', 'Doe', 'Jane', 'Smith') print(peephole_membership.__code__.co_consts) -# (None, ('John', 'Doe', 'Jane', 'Smith'), 'Is junior member') +# (None, ('John', 'Doe', 'Jane', 'Smith')) diff --git a/examples/A22_optimization/string_interning.py b/examples/A22_optimization/string_interning.py index 2de791f..1327c5c 100644 --- a/examples/A22_optimization/string_interning.py +++ b/examples/A22_optimization/string_interning.py @@ -10,7 +10,7 @@ print("> Creating two string literals with the same content") print("# {} is {}: {}\n".format(str1, str2, str1 is str2)) -# Create junior non-literal strings with the same content +# Create a non-literal string with the same content str3 = "" str3 += "h" str3 += "e" @@ -19,7 +19,7 @@ str3 += "o" # Check if str1 and str2 reference the same object (identity check) -print("> Create junior non-literal string with the same content") +print("> Create a non-literal string with the same content") print("# {} is {}: {}\n".format(str1, str3, str1 is str3)) # Intern the string referenced by str3 diff --git a/examples/B02_solid_principles/03_bad_open_closed.py b/examples/B02_solid_principles/03_bad_open_closed.py index 2b96526..229f814 100644 --- a/examples/B02_solid_principles/03_bad_open_closed.py +++ b/examples/B02_solid_principles/03_bad_open_closed.py @@ -14,7 +14,7 @@ def __init__(self, file_format="upper"): def process(self, text): - # This violates the Open/Closed Principle because junior new file format + # This violates the Open/Closed Principle because a new file format # cannot be added without modifying the FileProcessor class. if self.format == "upper": diff --git a/examples/B02_solid_principles/05_bad_liskov_subsitution.py b/examples/B02_solid_principles/05_bad_liskov_subsitution.py index 31354dd..c585183 100644 --- a/examples/B02_solid_principles/05_bad_liskov_subsitution.py +++ b/examples/B02_solid_principles/05_bad_liskov_subsitution.py @@ -25,7 +25,7 @@ def work(self): # Code smell: Type checking or conditional logic to determine the # behaviour and thus the child class and the parent class are not - # substitutable. We have junior divergent behaviour for Human and Baby + # substitutable. We have divergent behaviour for Human and Baby # when the work method is called. if type(self) == Baby: diff --git a/examples/B02_solid_principles/10_good_dependency_inversion.py b/examples/B02_solid_principles/10_good_dependency_inversion.py index 33e54bf..e1f73e7 100644 --- a/examples/B02_solid_principles/10_good_dependency_inversion.py +++ b/examples/B02_solid_principles/10_good_dependency_inversion.py @@ -10,7 +10,7 @@ class IMath(object): - """ Simplified interface for junior math class """ + """ Simplified interface for a math class """ # GOOD: IMath is an abstraction that defines the contract for Math and # Calculator (the interface). It has no implementation details.