New submission from Ryan Govostes :
argparse supports consuming multiple command-line arguments with nargs=2, etc.
It converts them to the type given in the argument's type parameter.
argparse does not provide a good solution when the input arguments should be
different data types. F
New submission from Ryan Govostes :
The documentation for the io.BufferedRWPair class gives this warning:
> BufferedRWPair does not attempt to synchronize accesses to its underlying raw
> streams. You should not pass it the same object as reader and writer; use
> BufferedRandom in
Ryan Govostes added the comment:
The origin of this warning involves interleaving read and write operations, and
was added here: https://bugs.python.org/issue12213
I'm not sure if it applies to sockets, pipes, etc. though.
The pySerial documentation advises using io.BufferedRWPair
Ryan Govostes added the comment:
This absolutely should be documented. If adding an earlier event is not
supported then it should raise an exception. Appearing the enqueue the event
but not triggering the callback is especially confusing. It may be obvious
behavior to someone who has spent
New submission from Ryan Govostes :
The documentation for weakref.proxy() does not describe how the proxy object
behaves when the object it references is gone.
The apparent behavior is that it raises a ReferenceError when an attribute of
the proxy object is accessed.
It would probably be a
Ryan Govostes added the comment:
Thanks Michael for all of the examples. After reading them all, I concur that
"it can be hard to conceptualize what the exact behavior should be." A
documentation change is warranted, at the least.
However the argparse documentation, while great
New submission from Ryan Govostes :
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('things', nargs=argparse.REMAINDER, default=['nothing'])
parser.parse_args([])
>>> Namespace(things=[])
Since there were no unparsed arguments remaini
Change by Ryan Govostes :
--
versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.org/issue35
Ryan Govostes added the comment:
Just don’t run the last line which is just an echoing of the output of
parser.parse_args() repeated. The Namespace type would need to be imported
if you really wanted to but there’s no point.
On Tuesday, May 7, 2019, Michael Blahay wrote:
>
> Michael
New submission from Ryan Govostes :
On macOS, shutil.copystat() uses chflags() to try to copy filesystem flags from
the source to destination.
In recent years, Apple introduced System Integrity Protection, which prevents
modification of system files. These files have the non-standard
Change by Ryan Govostes :
--
keywords: +patch
pull_requests: +4806
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32347>
___
___
Py
New submission from Ryan Govostes:
I cannot find a way to break a long number across multiple lines, other than to
write the number as a string, take advantage of string literal concatenation,
and then convert the string to an integer.
I'd like to be able to write, for exampl
12 matches
Mail list logo