Rajendra Dharmkar

Rajendra Dharmkar

153 Articles Published

Articles by Rajendra Dharmkar

Page 16 of 16

Do recursive functions in Python create a new namespace each time the function calls itself?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 30-Jul-2019 231 Views

Yes, a function call (any function call, not just recursive ones) creates a new namespace. BUT, when given as parameters, OBJECTS are passed by reference.So, the new namespace get its own copy of this reference but it still refers to the same object as in the calling function, and if you change the content of that object, you will notice the change in the calling function.To be more specific, Whenever the Interpreter encounters a call to a function, its creates a frame object, which is pushed to a frame stack. Each time a frame is created, that frame is given ...

Read More

What is the max length of a Python string?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 30-Jul-2019 4K+ Views

With a 64-bit Python installation, and 64 GB of memory, a Python 2 string of around 63 GB should be quite feasible. If you can upgrade your memory much beyond that, your maximum feasible strings should get proportionally longer. But this comes with a hit to the runtimes.With a typical 32-bit Python installation, of course, the total memory you can use in your application is limited to something like 2 or 3 GB (depending on OS and configuration), so the longest strings you can use will be much smaller than in 64-bit installations with very high amounts of RAM.

Read More

Where can I find good reference document on python exceptions?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 30-Jul-2019 126 Views

The following link is a  good reference document on python exceptionshttps://docs.python.org/2/library/exceptions.html

Read More
Showing 151–153 of 153 articles
« Prev 1 12 13 14 15 16 Next »
Advertisements