Rajendra Dharmkar has Published 496 Articles

How to import everything from a python namespace / package?

Rajendra Dharmkar

Rajendra Dharmkar

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

417 Views

It is a bad idea to be importing everything from a Python package as a package is not a super-module -- it's a collection of modules grouped together. So you should just import what you need in that file. Also importing everything from package into your global namespace is going ... Read More

Where's the standard python exception list for programmers to raise?

Rajendra Dharmkar

Rajendra Dharmkar

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

63 Views

I want to know what all standard exceptions are there in python. Where can I find a list of standard python exceptions?The standard python exception list for programmers is available athttps://docs.python.org/3/library/exceptions.html

What is the max length of a Python string?

Rajendra Dharmkar

Rajendra Dharmkar

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

3K+ 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 ... 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

64 Views

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

36 Views

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

2K+ Views

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