diff --git a/06/alchemy/__init__.py b/06/alchemy/__init__.py index 72b6ba4..c0f69c9 100644 --- a/06/alchemy/__init__.py +++ b/06/alchemy/__init__.py @@ -2,4 +2,4 @@ from .elements import create_fire, create_water __version__ = "1.0.0" __author__ = "Master Pythonicus" -__all__ = [create_fire(), create_water()] +__all__ = ["create_fire", "create_water"] diff --git a/06/alchemy/transmutation/__init__.py b/06/alchemy/transmutation/__init__.py new file mode 100644 index 0000000..0129229 --- /dev/null +++ b/06/alchemy/transmutation/__init__.py @@ -0,0 +1,11 @@ +from .basic import lead_to_gold, stone_to_gem +from .advanced import philosophers_stone, elixir_of_life + +__version__ = "1.0.0" +__author__ = "Master Pythonicus" +__all__ = [ + "lead_to_gold", + "stone_to_gem", + "philosophers_stone", + "elixir_of_life", +] diff --git a/06/alchemy/transmutation/advanced.py b/06/alchemy/transmutation/advanced.py new file mode 100644 index 0000000..984b308 --- /dev/null +++ b/06/alchemy/transmutation/advanced.py @@ -0,0 +1,11 @@ +from .basic import lead_to_gold +from ..potions import healing_potion + + +def philosophers_stone() -> str: + return f"Philosopher’s stone created using {lead_to_gold()}\ + and {healing_potion()}" + + +def elixir_of_life() -> str: + return f"Elixir of life: eternal youth achieved!" diff --git a/06/alchemy/transmutation/basic.py b/06/alchemy/transmutation/basic.py new file mode 100644 index 0000000..eb8e57d --- /dev/null +++ b/06/alchemy/transmutation/basic.py @@ -0,0 +1,9 @@ +from alchemy.elements import create_fire, create_earth + + +def lead_to_gold() -> str: + return f"Lead transmuted to gold using {create_fire()}" + + +def stone_to_gem() -> str: + return f"Stone transmuted to gem using {create_earth()}" diff --git a/06/ft_pathway_debate.py b/06/ft_pathway_debate.py new file mode 100644 index 0000000..dd69e76 --- /dev/null +++ b/06/ft_pathway_debate.py @@ -0,0 +1,48 @@ +def absolute_import() -> None: + from alchemy.transmutation import lead_to_gold, stone_to_gem + + print(f"lead_to_gold(): {lead_to_gold()}") + print(f"stone_to_gem(): {stone_to_gem()}") + + +def relative_import() -> None: + from alchemy.transmutation.advanced import ( + philosophers_stone, + elixir_of_life, + ) + + print(f"philosophers_stone(): {philosophers_stone()}") + print(f"elixir_of_life(): {elixir_of_life()}") + + +def package_import() -> None: + import alchemy.transmutation + + print(f"alchemy.transmutation.lead_to_gold():\ + {alchemy.transmutation.lead_to_gold()}") + print(f"alchemy.transmutation.philosophers_stone():\ + {alchemy.transmutation.philosophers_stone()}") + + +def main() -> None: + print("=== Pathway Debate Mastery ===\n") + print("Testing Absolute Imports (from basic.py):") + try: + absolute_import() + except Exception as err: + print(err) + print("\nTesting Relative Imports (from advanced.py):") + try: + relative_import() + except Exception as err: + print(err) + print("\nTesting Package Access:") + try: + package_import() + except Exception as err: + print(err) + print("\nBoth pathways work! Absolute: clear, Relative: concise") + + +if __name__ == "__main__": + main()