JitterMan added the comment:
Ah, that make sense. Thanks!
--
___
Python tracker
<https://bugs.python.org/issue39601>
___
___
Python-bugs-list mailing list
Unsub
JitterMan added the comment:
Okay, I get it. Someone might be using two braces in the format specifier
because they found that it is a way to both evaluate a sub-expression and get
braces in the formatted result. I was thinking that they would just use three
braces, but that does not appear
JitterMan added the comment:
I believe it is worth fixing as it clears up some rather glaring
inconsistenciesā£
and enables a useful capability. Specifically,
1. Formatted string literals and the string format method are currently
inconsistent in the way that they handle double braces in
JitterMan added the comment:
My expectation is that doubling up the braces acts to escape them, meaning that
characters between the braces is treated as simple text and passed to the
__format__ method as is. The only processing that should occur on the format
specification is to convert the
JitterMan added the comment:
It appears as if escaping the braces by doubling them up is not working
properly if the braces are in a format specification within a f-string.
>>> print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}')
>>>
New submission from JitterMan :
It appears as if escaping the braces by doubling them up is not working
properly if the braces are in a format specification within a f-string.
>>> print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}')
>>>
JitterMan added the comment:
Globbing has been with us for almost 50 years, and in all that time it has
never matched the hidden files/directories. There may be isolated cases where
matching the hidden items is preferred, but generally that is not the case.
Indeed, the primary characteristic
JitterMan added the comment:
It may be what the documentation says it will do, but is not what it should do.
I believe that because:
1. Currently ** in pathlib matches only directories, but **.py matches files.
That seems inconsistent.
2. In bash, and csh, ** matches files and directories. To
JitterMan added the comment:
I don't know that passing '' as a pattern to glob() makes much sense, but it is
useful when passed to match(). Doing so allows me to build a filter that can
easily and naturally be disabled. For example, the following allows me to get
all the items
New submission from JitterMan:
The title says it all.
The shell version of '*' and '**' return both directories and files.
Path('.').glob('*') returns both directories and files, but
Path('.').glob('**') returns only directorie
JitterMan added the comment:
The same issues applies with '**', where it is harder to work around. The shell
version of '**' prunes out hidden files and directories at all levels, whereas
the pathlib.glob() includes all hidden directories.
Major surgery would be required
New submission from JitterMan:
One can use '*' as an 'accept all' pattern to match(). It would be nice to also
use '' as a 'reject all' pattern. These 'accept all' and 'reject all' rules are
useful as defaults. Currently passing
New submission from JitterMan:
Path('.').glob('*') generates all files and directories in '.' including hidden
files (those that begin with '.'). This behavior is inconsistent with the shell
and with the old glob module, which only generate hidden
JitterMan added the comment:
I ran into this problem when I gave https_proxy an invalid value:
export https_proxy=http://foo.com
No divine intervention required. I was just trying to determine what message
was printed with the proxy environment variable was set incorrectly.
Perhaps that
New submission from JitterMan:
In python2.7.9, httplib.py, on line 780, makes a call to:
line = response.fp.readline(_MAXLINE + 1)
This ends up calling a function defined on line 1362 in the same file:
def readline(self):
Notice the argument mismatch. The call passes two arguments
15 matches
Mail list logo