Skip to content

Commit 2a8b759

Browse files
authored
clarify intent of example module property
1 parent 9d76a93 commit 2a8b759

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

source/tutorials/packaging-projects.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ To create this project locally, create the following file structure:
2525
Once you create this structure, you'll want to run all of the commands in this
2626
tutorial within the top-level folder - so be sure to ``cd packaging_tutorial``.
2727

28-
You should also edit :file:`example_pkg/__init__.py` and put the following
29-
code in there:
28+
Next edit :file:`example_pkg/__init__.py` and insert the following code:
3029

3130
.. code-block:: python
3231
33-
name = "example_pkg"
32+
test_string = "hello"
3433
35-
This is just so that you can verify that it installed correctly later in this
36-
tutorial and is not used by PyPI.
34+
We'll use this later in the tutorial to verify that the package installed correctly.
3735

3836
.. _Python documentation for packages and modules:
3937
https://docs.python.org/3/tutorial/modules.html#packages
@@ -303,15 +301,15 @@ Run the Python interpreter (make sure you're still in your virtualenv):
303301
304302
python
305303
306-
And then import the module and print out the ``__name__`` property. This should be
307-
the same regardless of what you name you gave your :term:`distribution package`
304+
And then import the module and print out the ``test_string`` property of our example. The module name
305+
should be the same regardless of what name you gave your :term:`distribution package`
308306
in :file:`setup.py` (in this case, ``example-pkg-your-username``) because your :term:`import package` is ``example_pkg``.
309307

310308
.. code-block:: python
311309
312310
>>> import example_pkg
313-
>>> example_pkg.__name__
314-
'example_pkg'
311+
>>> example_pkg.test_string
312+
'hello'
315313
316314
317315
Next steps

0 commit comments

Comments
 (0)