Hey folks,
My first post as a new python.org account holder. I’ve been programming in Python for several years, and maybe I’m an average Python programmer by now.
The products I work on are all Linux-based. Over the years those products have used Python 3.5, 3.11 and 3.12. I’ve done a fair amount of Python dev on my Macbook Pro, using the same Python version on my Mac that our products use.
Currently my Mac is running 15.3.2 and I have Python 3.11.3 and 3.12.8 installed. These have been installed using pip (currently version 25.0.1).
My dilemma: I had just written some code and ran pylint 3.3.6 against it, and got an error because I made use of time.CLOCK_BOOTTIME.
escan.py:2741:35: E1101: Module 'time' has no 'CLOCK_BOOTTIME' member (no-member)
That struck me as odd, since time.CLOCK_BOOTTIME dates back to Python 3.7. But a quick test proved that on my Mac neither 3.11.3 nor 3.12.8 have time.CLOCK_BOOTTIME. In contrast, if I perform the same test on our products that run those versions of Python (on Linux) then there’s no problem, it’s present.
Here’s the failure on my Mac with Python 3.12.8:
$ python3.12
Python 3.12.8 (v3.12.8:2dc476bcb91, Dec 3 2024, 14:43:20) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.CLOCK_BOOTTIME
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'time' has no attribute 'CLOCK_BOOTTIME'. Did you mean: 'CLOCK_REALTIME'?
>>>
On the product that uses 3.12 I get the expected value of 7.
Can anybody please help me understand how a built-in such as time could be different for the same Python version but different target OSes (Linux vs Macos)?
I have done quite a few internet searches about this and come up empty so far. I’ll keep searching, and welcome any URLs that have addressed this.
Thanks so much for any thoughts/ideas/tips/links.
Blessings,
Doug