473,396 Members | 1,861 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.

Wording suggestion for documentation (Data Model)

#!python

"""
In the documentation for __del__ (under Python Language Reference/Data
Model), the following warning is indicated:

Warning [Caveat in 2.6]: Due to the precarious circumstances under
which __del__() methods are invoked, exceptions that occur during
their execution are ignored, and a warning is printed to sys.stderr
instead. ...

That statement appears, however, to be incorrect.

Perhaps the warning should be re-worded to say "When __del__() methods
are invoked, exceptions that occur during the execution of such
methods must be caught and handled within the scope of the __del__()
method call. Otherwise unhandled exceptions will be ignored except
for a warning printed to sys.stderr instead."

For example,
"""

class X(object):
def __del__(self):
print 'deleting', self
try:
raise Exception, "OMG!"
except:
print 'caught exception, np'
print 'made it past the exception'

x = X()
del x

print 'x has been deleted, now what?'

"""
All this prints something like:

deleting <__main__.X object at 0x01BB1A50>
caught exception, np
made it past the exception
x has been deleted, now what?
"""

# - Jason R. Coombs
Jun 27 '08 #1
0 729

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

Similar topics

0
by: Jeff Levinson [mcsd] | last post by:
I'm an architect for a very large fortune 100 company and we still struggle with the best balance. However, I use a couple of simple guidelines that have worked very well for me in almost all...
0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
3
by: Frankie Montenegro | last post by:
Hi everyone, I must say that, even though I think that Accelerated C++ by Koenig and Moo is an awesome text, the wording of exercises is very poor. I spend half the time just trying to figure...
7
by: Swilson513 | last post by:
I'm trying to make what should be a simple DB, but have done got myself confused. I'm trying to keep track of the contents of several kits that use common components. Each component has a unique...
8
by: Steve Jorgensen | last post by:
Recently, I've been working on an Access application that is supposed to be the prototype for a larger system that will be developed by a team using Oracle tools, etc. As such, everything I do...
4
by: Davíð Þórisson | last post by:
Hi, when I was programmin ASP/JScript I had a very nice utilitiy which I got from MSDN (Script56.CHM). It's simply a help file but containing object orientiated documentation of all scripting...
5
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
0
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.