replacing the open function - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: replacing the open function (/thread-15652.html) |
replacing the open function - Skaperen - Jan-26-2019 in a script where the builtin open() function does not need to be called, but os.open() does get called, what will happen if os.open is imported over open and the os.open() calls are changed to open() calls (besides the confusion to readers) ? from os import close,open RE: replacing the open function - snippsat - Jan-26-2019 If import like that then it will overwrite build in open() . If ever want to use os.open()(never used it).Then do not import like that,but use import os .Doc Wrote:Note This function is intended for low-level I/O. RE: replacing the open function - Skaperen - Jan-27-2019 i've already read recommendations against doing it. but i am asking what will happen when that is done. i already know it will override the builtin open() function. i already know most python programmers will be confused. what else will it do? will it send wilted roses to my mother? |