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

Deletion of created object

440 256MB
Hi,

I have created objects 'n' number of times based on my requirement.Whether I have to delete this object variable for everytime ,when I use for next time

Say

for i in list:

-----

Obj = MyClass()

func1(Obj)


The above example shows that we are creating the objects for more than once and making use of it.But we are not deleting.

Whether the above approach is correct.
Thnaks
PSB
Apr 19 '07 #1
1 1184
bartonc
6,596 Expert 4TB
Hi,

I have created objects 'n' number of times based on my requirement.Whether I have to delete this object variable for everytime ,when I use for next time

Say

for i in list:

-----

Obj = MyClass()

func1(Obj)


The above example shows that we are creating the objects for more than once and making use of it.But we are not deleting.

Whether the above approach is correct.
Thnaks
PSB
Here is a useful-looking thread regarding Garbage Collection in Python.
Apr 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Morten Aune Lyrstad | last post by:
Here's the deal: I'm looping through a collection of listener class objects like this: (illustration code only) AClass::ThrowEvent() { for (int i = 0; i < numListeners; i++) {...
0
by: Dalan | last post by:
Although I have been able to prevent the deletion of keywords in a separate Access 97 combo box table, the code that I'm using probably requires updating because of the strange error messages that...
4
by: lauch2 | last post by:
I have a project that contains a COM object running in the in-process configuration. The project was developed by VC6.0 with SP 3. The project has been put into production for long period of time...
7
by: TJS | last post by:
javascript "confirm" fires after deletion instead of before deletion. how do I get this to stop the processing ? code ================== Sub ShowAlert(ByVal s As string)...
2
by: Rune Froysa | last post by:
I have one table with columns that are used as foreign-keys from several other tables. Sometimes deletion from this table takes +5 seconds for a single row. Are there any utilities that can be...
2
by: James Vanns | last post by:
How would one go about testing for the deletion of a file that sits under an ostream object? I've tried is_open, good(), fail(), eof(), bad() and catching exceptions - nothing! Aparently the <<...
1
by: Aff | last post by:
Dear Brothers, i am facing a problem class compactdisc { char title;/string a; int capacity; public:
2
by: Shana | last post by:
Hi Frnds, i need ur help to delete an object stored in an ArrayList(C#.Net.)I did try to use destructor but couldn't cleanup method to free the memory space. Actually I have created a menu...
4
by: lokki | last post by:
Hello, can anybody tell me what's wrong with following example code? char *k, *v; k = new char; strcpy(k, "a2"); v = new char;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.