473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Recommended way to fix core python distribution issues in your own apps?

I've got a case where I need to tweak the implementation of a default
python library due to what I consider to be an issue in the library.

What is the best way to do this and make an attempt to remain
compatible with future releases?

My specific problem is with the clock used in the threading.Event and
threading.Timer. It currently uses time.time, which is affected by
changes in system time. eg: if you change the system clock somehow at
some time (say, with an NTP broadcast) you may get a surprise in the
timing of your code execution.

What I do right now is basically this:

import sys
import time
import threading
if sys.platform == 'win32':
threading._time = time.clock

in which case I'm simply forcing the internal clock used in the
Event/Timer code to use a time-independent performance timer rather
than the system time.

I figured this is a much better way to do it than snagging a private
copy of threading.py and making a direct change to it, but am curious
if anyone has a better way of doing this type of thing? For example, I
have no way of guaranteeing that this hack will work come a change to
2.5 or later.

Thanks,
Russ

Jun 19 '06 #1
0 909

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Michael Scarlett | last post by:
There is an amazing article by paul graham about python, and an even better discussion about it on slashdot. The reason I point this out, is the more I read both articles, the more I realised how...
35
by: Michael Kearns | last post by:
I've been using python to write a simple 'launcher' for one of our Java applications for quite a while now. I recently updated it to use python 2.4, and all seemed well. Today, one of my...
28
by: doug.bromley | last post by:
Why is the ElementTree API not a part of the Python core? I've recently been developing a script for accessing the Miva API only to find all the core API's provided by Python for parsing XML is...
0
by: Fuzzyman | last post by:
It's finally happened, `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ is finally released. Versions for Python 2.3 & 2.4 are available from `The Movable Python Shop...
19
by: Vincent Delporte | last post by:
Hello I'm thinking of using Python to build the prototype for a business web appplication. The development and test machine is XP, while ultimate deployment will be on a shared Unix web host. ...
22
by: mattf | last post by:
I've discovered Python and have been trying it out lately as a possible replacement for computations that would ordinarily be done with a commercial package like Matlab or IDL. I'd like to mention...
15
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
7
by: Yansky | last post by:
I asked my hosting company if they would upgrade Python on my server to the latest version. They responded with: "Sorry no. We tend to stick with what comes packaged with the unix distribution...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.