Re: [Python-ideas] Python octal escape character encoding "wats"

2018-11-09 Thread Chris Angelico
On Sat, Nov 10, 2018 at 3:19 PM Steven D'Aprano wrote: > > On Sat, Nov 10, 2018 at 12:56:07PM +1100, Chris Angelico wrote: > > > Not ambiguous. It takes as many valid octal digits as it can. > > What is the rationale for that? Hex escapes don't. Irrelevant to whether it's ambiguous or not. > > "

Re: [Python-ideas] Python octal escape character encoding "wats"

2018-11-09 Thread Steven D'Aprano
On Sat, Nov 10, 2018 at 12:56:07PM +1100, Chris Angelico wrote: > Not ambiguous. It takes as many valid octal digits as it can. What is the rationale for that? Hex escapes don't. My guess is, "Because that's what C does". And C probably does it because "Dennis Ritchie wanted to minimize the num

Re: [Python-ideas] Python octal escape character encoding "wats"

2018-11-09 Thread Joao S. O. Bueno
On Fri, 9 Nov 2018 at 23:56, Chris Angelico wrote: > >>> list("\797") > ['\x07', '9', '7'] > The octal escape grabs as many digits as it can, and when it finds a > character in the literal that isn't a valid octal digit (same whether > it's a '9' or a 'q'), it stops. The remaining characters have

Re: [Python-ideas] Python octal escape character encoding "wats"

2018-11-09 Thread Chris Angelico
On Sat, Nov 10, 2018 at 12:42 PM Joao S. O. Bueno wrote: > > I just saw some document which reminded me that strings with a > backslash followed by 3 octal digits. When a backslash is followed by > 3 octal digits, that means a character with the corresponding > codepoint and all is well. > > The "

[Python-ideas] Python octal escape character encoding "wats"

2018-11-09 Thread Joao S. O. Bueno
I just saw some document which reminded me that strings with a backslash followed by 3 octal digits. When a backslash is followed by 3 octal digits, that means a character with the corresponding codepoint and all is well. The "valid scenaario": In [42]: "\777" Out[42]: 'ǿ' The problem is when yo

Re: [Python-ideas] Relative Imports

2018-11-09 Thread danish bluecheese
you are right on the lines you mentioned. Those are all working if i run it as a module which i do every time. This is somewhat unpleasant to me, especially while developing something and trying to test it quickly. I just want to be able to use same relative imports and run single file with `python

Re: [Python-ideas] Python-ideas Digest, Vol 144, Issue 24

2018-11-09 Thread Alex Shafer
I think this about the limitation to . and .. possibly? > > Message: 6 > Date: Sat, 10 Nov 2018 11:00:16 +1100 > From: Chris Angelico > To: python-ideas > Subject: Re: [Python-ideas] Relative Imports > Message-ID: > < > captjjmrtapaxib4wm6feh-xkpu_cf5rnx2tr0vzcaggxppg...@mail.gmail.com>

Re: [Python-ideas] Relative Imports

2018-11-09 Thread Steven D'Aprano
On Fri, Nov 09, 2018 at 03:51:46PM -0800, danish bluecheese wrote: > └── src > ├── __init__.py > ├── main.py > └── test > ├── __init__.py > └── test_main.py > > assume the structure above. To be able to use relative imports with such > fundamental structure either i can

Re: [Python-ideas] Relative Imports

2018-11-09 Thread Chris Angelico
On Sat, Nov 10, 2018 at 10:52 AM danish bluecheese wrote: > > └── src > ├── __init__.py > ├── main.py > └── test > ├── __init__.py > └── test_main.py > > assume the structure above. To be able to use relative imports with such > fundamental structure either i can go fo

Re: [Python-ideas] Relative Imports

2018-11-09 Thread danish bluecheese
└── src ├── __init__.py ├── main.py └── test ├── __init__.py └── test_main.py assume the structure above. To be able to use relative imports with such fundamental structure either i can go for sys.path hacks or could run as a module from one further level parent. I do n

Re: [Python-ideas] Relative Imports

2018-11-09 Thread Steven D'Aprano
On Fri, Nov 09, 2018 at 03:20:52PM -0800, danish bluecheese wrote: > It supports, but whenever you get multiple folders there is no clean > solution. What do you mean? -- Steve ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.

Re: [Python-ideas] Relative Imports

2018-11-09 Thread danish bluecheese
It supports, but whenever you get multiple folders there is no clean solution. Either there are some sys.path hacks or running things as modules in some cases. These are not pleasant at all. I think we can come up with something better. Interested in? On Fri, Nov 9, 2018 at 3:17 PM Steven D'Aprano

Re: [Python-ideas] Relative Imports

2018-11-09 Thread Steven D'Aprano
On Fri, Nov 09, 2018 at 02:54:50PM -0800, danish bluecheese wrote: > Im tired of not being able to make relative imports freely. Python has supported relative imports for a while now. https://docs.python.org/3/tutorial/modules.html#intra-package-references What do you mean? -- Steve __

[Python-ideas] Relative Imports

2018-11-09 Thread danish bluecheese
Hi all, Im tired of not being able to make relative imports freely. Now trying to develop a module which enable any project to use relative imports once it is loaded. Anybody interested in? Best, ___ Python-ideas mailing list Python-ideas@python.org htt