Matt Wozniski added the comment:
> My main hesitation with this name is that I suspect users may think that
> `use_utc_designator` means that they *unconditionally* want to use `Z` —
> without reading the documentation (which we can assume 99% of users won't do)
I was thinking
Change by Matt Wozniski :
--
keywords: +patch
pull_requests: +30131
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32041
___
Python tracker
<https://bugs.python.org/issu
Matt Wozniski added the comment:
Pardon me for necroing an old issue, but someone pointed out the surprising
behavior of `__len__` being called twice by `list(iterable)`, and it caught my
curiosity.
https://github.com/python/cpython/commit/372d705d958964289d762953d0a61622755f5386
made it
Matt Wozniski added the comment:
> I feel like "If the offset is 00:00, use Z" is the wrong rule to use
> conceptually
This is a really good point that I hadn't considered: `+00:00` and `Z` are
semantically different, and just because a datetime has a UTC offset of 0
d
Matt Wozniski added the comment:
I agree with Brett. Adding `allow_z` (or perhaps `compact` or
`use_utc_designator` if we're bikeshedding) as an optional keyword only
argument to `.isoformat()` would allow us to keep the explanation that what
`.fromisoformat()` can parse is exactly
Matt Wozniski added the comment:
> Syntactically, this could be many possible errors: missing comma, missing
> period, missing parens, missing brackets, etc.
Syntactically, it cannot be a missing comma. Adding the comma is a syntax error.
$ python3 -c 'if datetime.now(),strftime(
Matt Wozniski added the comment:
I wondered if it would be backwards compatible to make `pkgutil.get_data()`
delegate to `importlib.resources.read_binary()`. It isn't, because
`pkgutil.get_data()` accepts a relative path for the resource, and
`importlib.resources.read_binary()` accepts
Matt Wozniski added the comment:
The original case where I encountered this was with a namespace package, but
the behavior appears to be the same for a subpackage of a regular package.
--
title: pkgutil.get_data() doesn't add subpackages to namespaces when impo
New submission from Matt Wozniski :
If a module hasn't yet been imported, `pkgutil.get_data(pkg_name, data_file)`
will import it, but when it does, it doesn't add the submodule to its parent
package when the parent package is a PEP 420 implicit namespace package.
```
$ mkdir -p
Matt Wozniski added the comment:
> "!value" or "!!value" also has the issue if I understood correctly.
No, just as "value != 0" is an int, so is "!value".
--
___
Python t
Matt Wozniski added the comment:
The leftmost argument of the ternary is an int for every example that Victor
and I found in the stdlib, so no casting would be required in any of these
cases.
--
___
Python tracker
<https://bugs.python.
Matt Wozniski added the comment:
I spotted three other uses in the stdlib:
Modules/_io/_iomodule.c
raw = PyObject_CallFunction(RawIO_class, "OsOO",
path_or_fd, rawmode,
closefd ? Py_True
Matt Wozniski added the comment:
> but there is a catch -- the arguments should be a C int
Or a type that promotes to int. If you pass a C short or char, or a C++ bool,
it is implicitly promoted to int.
> so you will need to write "expr ? 1 : 0"
Or alternatively "!!
Change by Matt Wozniski :
--
keywords: +patch
nosy: +godlygeek
nosy_count: 7.0 -> 8.0
pull_requests: +22673
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/23812
___
Python tracker
<https://bugs.p
Matt Wozniski added the comment:
A simple test case for this issue:
~>mkdir tmp
~>cd tmp
tmp>touch 1.txt
tmp>ln -s subdir/file 2.txt
tmp>touch 3.txt
tmp>ls -l
total 0
-rw-rw-r-- 1 mwoznisk general 0 Mar 6 14:52 1.txt
lrwxrwxrwx 1 mwoznisk general 11 Mar 6 14:52 2.txt -&g
15 matches
Mail list logo