Skip to content

Commit

Permalink
Clarify usage of enums
Browse files Browse the repository at this point in the history
  • Loading branch information
zacikpa committed Jul 18, 2024
1 parent 5a1aae5 commit 995773d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ to the libcpuid C library.
# identify the current CPU and print some
# information about it
cpu_info = CPUInfo.from_current_cpu()
print(cpu_info.vendor.name)
print(cpu_info.architecture.name)
print(cpu_info.vendor)
print(cpu_info.architecture)
print(CPUFeature.FPU in cpu_info.features)
# print the list of all Intel CPU code names
Expand Down
5 changes: 3 additions & 2 deletions python/src/libcpuid/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
e.g., CPU architectures, vendors, or features.
For compatibility with the underlying C library, the values
of all enums are integers. To obtain a string representation
of an enum member, use the :func:`str` function.
of all enums are integers. However, calling the :func:`str`
or :func:`print` function on an enum member returns or prints
its string representation.
"""

from enum import IntEnum
Expand Down

0 comments on commit 995773d

Please sign in to comment.