Reputation: 435
As I understood, PYTHONCASEOK option enables importing modules by matching case insensitively. But, as almost everything in python is case sensitive, why does it has to enable this option enabling more lazy writing.
Any other reason for introducing?
Upvotes: 3
Views: 1949
Reputation: 55903
The purpose of PYTHONCASEOK is to enable finding module files on filesystems which are case-insensitive such as FAT
, or which behave in a case-insensitive manner from point of view of the programmer, such as NTFS
on Windows.
It exists to support code written for case-insensitive filesystems before case-sensitivity became the default behaviour when searching for modules in python 2.1.
The detailed explanation for the change is available in PEP 235
One interesting scenario described in the PEP is that some operating systems - such as OpenVMS - might change the case of a filename when the file is written:
if you create "fiLe", there's no telling what it's stored as -- but most likely as "FILE" -- and any of the 16 obvious variations on open("FilE") will open it.
so a case-insensitive method of finding the module is a necessity on such as system.
Upvotes: 4