473,385 Members | 1,486 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,385 software developers and data experts.

Statement coverage tools revisited

1 1120
Edvard Majakari wrote:
,----
| The coverage dictionary is called "c" and the trace function
| "t". The reason for these short names is that Python looks up variables
| by name at runtime and so execution time depends on the length of
| variables! In the bottleneck of this application it's appropriate to
| abbreviate names to increase speed.
`----

It was written when 2.1 was the most recent stable version. I wonder if it
still applies for 2.2 and later? According to my hasty tests it doesn't
seem to be so. I didn't have very large unit test files at hand, though.


It's no longer correct (if it ever was correct). Python internalises 'short'
strings (including identifiers) so that comparison can generally be done by
means of identity checks.

Py> long_and_really_complicated_var_name = 1
Py> "long_and_really_complicated_var_name" is "long_and_really_complicated_var_n
ame"
True
Py> "long_and_really_complicated_non_var_name" is "long_and_really_complicated_n
on_var_name"
True
Py> "long_and_really_complicated_non_var_name" * 20 is "long_and_really_complica
ted_non_var_name" * 20
False

Ah, the wonderful efficiencies of immutable types. . .

Cheers,
Nick.

--
Nick Coghlan | nc******@email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #2

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

Similar topics

3
by: John J. Lee | last post by:
Anybody know of one? Actually, I have a feeling that emacs understands a standard format for errors, which would make it really easy to implement this by having the coverage tool print results...
5
by: Richard Wesley | last post by:
I am using coverage.py to run my unit test suite to check for missing tests. It mostly works, but for some mysterious reason, some of the files can't be found because they are not in the same...
1
by: Vinay | last post by:
Hi Have any one idea of any popular code coverage tools for .Net application? Is there any such tool for Java also?? Thanks, -Vinu
7
by: patrickmee | last post by:
Hi all, The database that our php applications are running on is getting a major clean up. RI will be enforced, normalization and all that good stuff. Our QA department have a set of...
7
by: Kai Zhu | last post by:
Can anybody show me a list of such tools so that I can pick up the tools match my requirement.
2
by: Orin | last post by:
Hi, I have a problem in using coverage.py module in my project: ../cov -c Traceback (most recent call last): File "./cov", line 10, in ? coverage.the_coverage.command_line(sys.argv) File...
1
by: maralle.fakhereddin | last post by:
I am wondering if anyone knows of a good code coverage tool for ASP.Net applications? I already looked at NCover, ANTS profiler and am evaluating AQtime at the moment. Any help would be great....
2
by: Noah | last post by:
I'm trying to use the trace module to build coverage files for a multi-threaded program. http://docs.python.org/lib/module-trace.html I test my application using trace.py from the command-line...
2
by: innes | last post by:
I can't find anything on this in the VS2008 help (searching for 'coverage' returns no results). Can anyone confirm that VS2008's code coverage functionality doesnt extend to working on C++/CLI...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.