Rajendra Dharmkar has Published 504 Articles

What is the max length of a Python string?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

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 ... Read More

Why are Python exceptions named "Error" (e.g. ZeroDivisionError, NameError, TypeError)?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

We see that most exceptions have their names ending in word ‘error’ pointing that they are errors which is the meaning of exceptions anyway.Errors in restricted sense are taken to mean syntax errors in python and those errors occurring at run time are called exceptions. As we know that classes ... Read More

Where can I find good reference document on python exceptions?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

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

What is a namespace in Python?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

Namespace is a way to implement scope. In Python, each package, module, class, function and method function owns a "namespace" in which variable names are resolved. When a function,  module or package is evaluated (that is, starts execution), a namespace is created. Think of it as an "evaluation context". When ... Read More

Advertisements