[issue34414] Absolute imports conflict with local files

2018-08-17 Thread Ronald Oussoren
Ronald Oussoren added the comment: This behaviour is not a bug, even if it can be confusing at times. Please read . -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue34414] Absolute imports conflict with local files

2018-08-17 Thread Jonathan Hadida
Jonathan Hadida added the comment: With regards to "This has nothing to do with absolute imports at all.", I would like to point out that the "import math" statement that I am complaining about IS WITHIN THE NUMPY MODULE. So it seems very related to this bug. How can "import math", **written

[issue34414] Absolute imports conflict with local files

2018-08-17 Thread Jonathan Hadida
Jonathan Hadida added the comment: Thanks again for your reply, I really appreciate your time. Every language I know has reserved keywords, and a restricted syntax. Nothing to complain about there. Banning the use of tabs (PEP8) is pretty odd; but restricting file-names is just a whole new l

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Ronald Oussoren
Ronald Oussoren added the comment: This has nothing to do with absolute imports at all. You have two toplevel modules in an entry on sys.path that is before the stdlib (see the earlier message by Eric V. Smit for documentation on how the path is initialised). The name of one of those modules

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Eric V. Smith
Eric V. Smith added the comment: See https://docs.python.org/3/tutorial/modules.html#the-module-search-path Calling this a "hack", and "crazy", is not the way to get volunteers to help you with your issue. Please show a little more tolerance, please. -- nosy: +eric.smith ___

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Jonathan Hadida
Jonathan Hadida added the comment: Thank you for your quick reply. How can this be expected behaviour? Could I please kindly ask you to point to an documented explanation, specifically for why the folder is PREpended to sys.path (put before), instead of being APpended (put after). The fact

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Ronald Oussoren
Ronald Oussoren added the comment: This is expected behaviour: When your run a script the directory containing the script is added to the start of sys.path. Running "python3.6 a/foo.py" therefore adds "a" to the start of sys.path, and "math.py" then shadows the stdlib module "math". This ha

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Jonathan Hadida
New submission from Jonathan Hadida : This submission follows a post on StackOverflow: https://stackoverflow.com/q/51878397/472610 I have reproduced the unexpected behaviour with multiple python versions, either with a Homebrew install, or using Anaconda/Miniconda. Note that comments to the p