Task: Implement a Python package pyworld that provides a module my_module with a hello function, located under /app/pyworld/.
What to implement
A Python package named pyworld (i.e., a directory /app/pyworld with init.py) containing a module my_module.py.
In pyworld.my_module, implement the function:
def hello(name: str) -> str
Behavior:
If name is the string "nobody", raise ValueError with a message that includes "Can not say hello to nobody".
Otherwise, return the string "Hello {name}!" (exact formatting with the exclamation mark and a single space after Hello).
Optional but encouraged: perform a type check and raise TypeError("name must be a string") if name is not a string.
The function must work with the provided tests, including:
hello('nlesc') -> 'Hello nlesc!'
hello('nobody') raises ValueError containing 'Can not say hello to nobody'
hello(some_name) where some_name is 'Jane Smith' from a pytest fixture -> 'Hello Jane Smith!'
File structure and location
Create the following files:
/app/pyworld/init.py
/app/pyworld/my_module.py (containing the hello function)
Notes
The tests import the function using: from pyworld.my_module import hello, so the implementation must be a package named pyworld with a submodule my_module containing hello.
Implementation location: Place the code under /app/pyworld/ as described above. (The task description mentions /app/pyworld.py, but to satisfy the tests you must implement as a package at /app/pyworld/ with a module my_module.py.)