Eric V. Smith added the comment:
I'm going to reject this. There's nothing special about dataclasses that would
require a feature like this.
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Pyt
Eric V. Smith added the comment:
Possibly a use for positional-only parameters. Backward compatibility is the
question, of course.
--
___
Python tracker
<https://bugs.python.org/issue37
Eric V. Smith added the comment:
As ztane says, the issue isn't the -1, it's the type of the cast. This looks
like a legitimate issue to me.
--
nosy: +eric.smith
resolution: not a bug ->
stage: resolved -> patch review
status
Eric V. Smith added the comment:
There was a recent discussion about this on the bug tracker, but of course now
I can't find it. But for an earlier discussion, see issue 25885.
The decision was that your expectation that the nodes be distinguishable isn't
a design goal of the as
Eric V. Smith added the comment:
I think Popen() is just about as complex as anyone wants it to be. Is there
something about .run() or .check_call() that keeps you from using them?
--
nosy: +eric.smith
versions: +Python 3.9
___
Python tracker
Eric V. Smith added the comment:
I figured as much (but didn't want to lead the witness!).
I'm not completely opposed to this. I think the best thing to do is to bring up
the proposal on python-ideas, and point here.
--
___
Python track
Eric V. Smith added the comment:
And what is your expected result, and why?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37227>
___
___
Eric V. Smith added the comment:
Although note that with allow_abbrev=False, -l will conflict with --long, which
I'm not sure is a great design.
I'm closing this as not a bug, since it works as documented and there's a
workaround (albeit not in 2.7, which is closed
Eric V. Smith added the comment:
Closing as not a bug. This is how python works: you do not want to name a file
the same as any standard library module. Use a file name other than http.py.
--
components: +Library (Lib) -Windows
nosy: +eric.smith -paul.moore, steve.dower, tim.golden
Eric V. Smith added the comment:
Please do not post images: we can't copy and paste from them, and they're
unfriendly to visually impaired users.
Can you create code that reproduces this? A small example, with no external
dependencies would be best. Please attach the reproducer
Eric V. Smith added the comment:
This still isn't an example we can copy and paste to reproduce, so I'm going to
be unable to help you. Sorry.
Again: please don't post images, for the reasons I previously stated.
--
___
Python
Eric V. Smith added the comment:
After fixing a missing import (import urllib.request), this is what I get:
$ /usr/local/bin/python3.6 pbr37241_Jesse_Bacon.py
Fetching nvdcve-1.0-2019.json.gz
Storing Gzipped File
Loading JSON Content
4275 records
4275 unique records
Creating Shelve: cve_2019
Eric V. Smith added the comment:
Since ++i already has a meaning, it won't become a syntax error without an
extremely good reason, and I don't think this case meets that standard.
But as Steven says, if you want to pursue it, you should start with a
discussion on py
Eric V. Smith added the comment:
> str.format, string.Formatter, and the _string module can only
> parse literal keys, not expressions, despite appearing to take the
> same syntax as f-strings. I'm happy to contribute code to change
> this, but unsure if it's considered
Eric V. Smith added the comment:
I've fixed the bpo number in Misc/NEWS.d/3.8.0b1.rst. Thanks for reporting that.
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
nosy: +brett.cannon, eric.smith
___
Python tracker
<https://bugs.python.org/issue37409>
___
___
Python-bugs-list mailing list
Unsub
Eric V. Smith added the comment:
Can you provide a short runnable example that used to work and now does not?
And please show any error messages you're seeing.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
2to3 is designed to convert python2 code to python3. It is not designed to work
on python3 code.
I believe this behavior is correct.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37
Eric V. Smith added the comment:
You might also want to look at python-modernize or similar tools.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.python
Eric V. Smith added the comment:
It's a _NamespacePath in 3.7 because there's no __init__.py in the top-level
"google" directory, and that makes it a namespace package.
I'm not exactly sure why it works in 2.7, frankly. Looking some
more: it's because they
Eric V. Smith added the comment:
And I see you're not asking for changed behavior, just documentation. But I
think it is documented that this is how namespace packages work.
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue37357>
___
___
Python-bugs-list
Eric V. Smith added the comment:
I'm working on overhauling how these are calculated. But it's complex, and is
taking a while.
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.pytho
Eric V. Smith added the comment:
Note that this isn't really related to f-strings, except that they use the
__format__ protocol, as does str.__format__.
>>> format(myIntEnum.x)
'1'
--
nosy: +eric.smith
___
Python tracker
Eric V. Smith added the comment:
I agree with xtreak that this works as designed and isn't a bug.
--
assignee: -> eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<htt
Eric V. Smith added the comment:
RFC 1034 defines absolute domain names as ending with dot:
When a user needs to type a domain name, the length of each label is omitted
and the labels are separated by dots ("."). Since a complete domain name ends
with the root l
Eric V. Smith added the comment:
Counterpoint: I just sent an email to "info@info.", and Thunderbird and my MTA
(postfix) and my mail relay all accepted it. I guess it's possible that a TLD
(especially one of the newer ones) could accept email addresses in the TLD
itself.
It
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37501>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Also surprised by the marked dataclasses tests. I don't see anything there that
requires docstrings. See my review on the PR.
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37510>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
It's my understanding that this is a quality of implementation issue, and that
in other (non-CPython) implementations, the run time for repeated concatenation
may indeed be quadratic.
The optimization in CPython relies on knowing the reference count is
Eric V. Smith added the comment:
Thanks for the great explanation, Steven. And I agree with Josh that changing
the exception text would lead to blindly adding nonlocal or global in a
superficial attempt to get the code to work. The much more likely problem is
already mentioned: reference
Eric V. Smith added the comment:
'\.' is an invalid escape sequence. Could you try it with a raw string?
Also, it's not really clear to me what you're seeing, vs. what you expect to
see. For one example that you think is incorrect, could you show what you get
vs. what yo
Eric V. Smith added the comment:
Sorry. '\.' will be invalid in the future. I got ahead of myself.
$ python3 -Werror -q
>>> '\.'
File "", line 1
SyntaxError: invalid escape sequence \.
Not that it would have affected your issue, so I apologize f
Eric V. Smith added the comment:
While some of these might be inconsistent (I haven't really looked at it
thoroughly yet), I think it might be problematic to change them at this point,
since there's no doubt code out there that depends on the curren
Change by Eric V. Smith :
--
assignee: -> rhettinger
nosy: +eric.smith, rhettinger
___
Python tracker
<https://bugs.python.org/issue37623>
___
___
Python-
Eric V. Smith added the comment:
Because variable belongs to the class, and not any instance of the class, you
can duplicate this behavior without creating any instances at all:
>>> class TestClass(object):
... variable = []
...
>>> TestClass.variable.append(1)
>>
Eric V. Smith added the comment:
Also, you might want to search for "python class and instance variables". This
one looks decent, although I didn't read it exhaustively:
https://howchoo.com/g/nzy0mthhyzl/understanding-class-vs-instance-variab
Eric V. Smith added the comment:
I think using a dataclass here would be easier, since you can control class
variables. Is there some reason that your loader must be a namedtuple?
Something like:
from typing import ClassVar
from dataclasses import dataclass
@dataclass
class MyLoader
Eric V. Smith added the comment:
Yes, this should be discussed on python-ideas first, so I'm closing it here.
But to be honest with you, there's really no chance this would get accepted.
It's just too easy to do it with existing list comprehension syntax, which is
much more
Eric V. Smith added the comment:
I've put some more thought in to this, and this is the best I can come up with,
using today's Python.
The basic idea is that you have a function _f(), which takes a normal (non-f)
string. It does a lookup to find the translated string (again, a n
Eric V. Smith added the comment:
2to3 is not designed to turn every valid python2 program into a valid python3
program. You'll have to provide a way to compare GameClock objects. I suggest
you look at http://python3porting.com. You should read the whole site, it's a
grea
Eric V. Smith added the comment:
example_text is not a field, since you're not giving it a type. It's just a
normal class member.
The only field in the NamedTuple is example_int. You can't specify any other
field in the call to MyTestedTuple().
To see this, help(MyTestedTup
Eric V. Smith added the comment:
This looks like a problem in pandas.
If you can distill this down to a short python program that doesn't include any
third party libraries, then we can take a look at it.
Otherwise, I suggest reporting it on the pandas bug tracker.
--
compo
New submission from Eric V. Smith :
https://docs.python.org/3/library/argparse.html#choices says "These can be
handled by passing a container object as the choices keyword argument to
add_argument()".
I think this should be "iterable" instead. Internally, argparse rea
Eric V. Smith added the comment:
shireenrao: yes, please! As they say, PR's accepted!
I'll warn you that I think the only way this could become newcomer-unfriendly
is if there are objections that "iterable" is too much jargon for the argparse
documentation. But I
Eric V. Smith added the comment:
Actually, I might have mislead you on this. I now think that plain iterators
won't work. I'm still researching this, I'll get back to you on it. I apologize
if it turns out I wasted your time.
--
___
Eric V. Smith added the comment:
Sorry, shireenrao, but I'm closing this. It's entirely my error: I misread the
source where it was converting this to a list.
The requirement is really that it be something you can iterate over multiple
times, and supports "in". I guess &
Change by Eric V. Smith :
--
components: +Interpreter Core
type: -> crash
___
Python tracker
<https://bugs.python.org/issue37830>
___
___
Python-bugs-list mai
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37830>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith:
Now that **kwargs are sorted, it would be better if the error given by a
unittest subTest (as implemented in uniitest._case._SubTest) didn't sort the
parameters when they're printed, but instead printed them out in order.
This might be complica
Eric V. Smith added the comment:
Correction: it's implemented in unittest.case._SubTest, specifically in
_subDescription().
--
title: Change unittest's _SubTest to not sort its params -> Change unittest's
_SubTest to not sort its params when prin
Eric V. Smith added the comment:
Good question.
It looks like ChainMap does something I wouldn't expect:
>>> for k, v in ChainMap({'a': 0, 'b': 1, 'c': 2}, {'b': 3, 'a': 4}).items():
... print(k, v)
...
b 1
a 0
c 2
Once we def
Eric V. Smith added the comment:
Correct on the order changed with regular dicts. That's why I'm targeting this
specifically for Python 3.7 and with **kwargs, where order is guaranteed. We
might have to use a structure other than a ChainMap of dicts, like a ChainMap
of
Changes by Eric V. Smith :
--
pull_requests: +2277
___
Python tracker
<http://bugs.python.org/issue30529>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith:
>>> eval("f'\\\n'")
python: Python/ast.c:4906: FstringParser_ConcatFstring: Assertion
`!state->last_str || PyUnicode_GET_LENGTH(state->last_str) != 0' failed.
[2]12810 abort (core dumped) ./python
The problem is t
Changes by Eric V. Smith :
--
pull_requests: +2285
___
Python tracker
<http://bugs.python.org/issue30682>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
New changeset 2eca5b465f7404cc8484457b7966f828f434ec20 by ericvsmith (Serhiy
Storchaka) in branch '3.6':
[3.6] bpo-30682: Removed a too-strict assertion that failed for certain
f-strings. (GH-2232) (#2242)
https://github.com/python/cpyt
Eric V. Smith added the comment:
Terry:
The eval is important. The bug was in evaluating an f-string that consisted of
two bytes: a backslash followed by a newline.
And just as:
eval("'\\\n'") == '' # len == 0
so should
eval("f'\\\n'") ==
Eric V. Smith added the comment:
The reason that this was done was to give us flexibility in deciding how the
backslashes should be interpreted in the future. I announced it on python-dev
here: https://mail.python.org/pipermail/python-dev/2016-August/145979.html.
That message contains a link
Eric V. Smith added the comment:
We absolutely cannot change this to give an error if the second or subsequent
parameters is absolute. I have code that reads user-named config files. If the
path is relative, it's relative to a config directory, but it's allowed to be
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue30978>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm -0 on a backport. The new behavior is more correct, but I don't like
changing the exception type in a micro release.
--
___
Python tracker
<http://bugs.python.o
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue31136>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
On 3.6.1 on Windows, I get:
% python3 bpo-31140.py
File "", line 1
(a>2s)
^
SyntaxError: invalid syntax
Which is far from ideal, but at least points to (a portion of) the correct text.
I won't have access to a copy of 3.6.2
Eric V. Smith added the comment:
Thanks. There was some work on this recently: I'll try and check 3.7 later
today.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
I'm in favor of backporting to 3.6. It's not an intrusive change and is helpful
in porting 2.x scripts.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
Jim: did you forget to attach the z.py script?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue31
Eric V. Smith added the comment:
I think this is a function of the .pth file causing 'zc' to be in sys.modules.
If I delete the .pth file, the first import of zc.m succeeds.
Note that if the .pth file is in place, then:
% bin/python3
Python 3.6.1 (default, Mar 24 2017, 12:50:34)
Eric V. Smith added the comment:
No problem. If you open a pypa issue, can you post a link here? Thanks.
--
resolution: -> not a bug
type: -> behavior
___
Python tracker
<http://bugs.python.org/i
Eric V. Smith added the comment:
New changeset 06de1aeff94e524bed21d188065c4cd1590fb046 by ericvsmith (Zhiming
Wang) in branch 'master':
bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
https://github.com/python/cpython/commit/06de1aeff94e524bed21d188065c4c
Eric V. Smith added the comment:
I did not backport this to 3.6, because it depends on other changes that
themselves have not been backported.
--
assignee: -> eric.smith
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions: -Python 3.4
Changes by Eric V. Smith :
--
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/issue31140>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Eric V. Smith :
--
versions: +Python 3.7
___
Python tracker
<http://bugs.python.org/issue31140>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
See also issue 31140: I'm not sure if that case is covered by this issue.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
I'm thinking that instead of supporting backslashes in general inside
expressions, I'll just special case strings.
So:
f"{'\n' if foo else ''}"
would be okay, but not:
f"{a\
}"
I think that would address the r
Eric V. Smith added the comment:
New changeset e7c566caf177afe43b57f0b2723e723d880368e8 by ericvsmith (Ćukasz
Langa) in branch 'master':
bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)
https://github.com/python/cpython/commit/e7c566caf177afe43b57f0b2723e72
Eric V. Smith added the comment:
New changeset aa1afc72c1ee1f090e6302198d9a0295f1ce1c05 by ericvsmith (Miss
Islington (bot)) in branch '3.6':
bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)
https://github.com/python/cpyt
Eric V. Smith added the comment:
That code is an error in Python 3.6:
>>> f"{eval('bool(0)\
... and True\
... ')}"
File "", line 3
SyntaxError: f-string expression part cannot include a backslash
>>>
I'm not sure it's a good idea th
Change by Eric V. Smith :
--
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue35271>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
I dynamically load a lot of modules whose names contain hyphens, or are
otherwise non-identifiers (like 3rdparty.py). The suggested change would break
a lot of working code.
The only thing I can see being possible is to add a warning that no one would
Eric V. Smith added the comment:
Can you be more specific? There's not enough information here to take any
action.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
The ... denotes a recursive data structure, which is what you've created here
by "a" including itself as an element. I'm not clear what you expected to see,
but I'm going to close this because I don't see an actual problem here.
Eric V. Smith added the comment:
Possibly related to issue 33954?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue35432>
___
___
Python-bug
Eric V. Smith added the comment:
Why the title change? The original problem still exists, and I don't see how
it's related to subparsers.
--
___
Python tracker
<https://bugs.python.
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue35494>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
Go ahead, Serhiy. Thanks!
--
assignee: eric.smith -> serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issu
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue35540>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
I think this falls in to the consenting adults category. You can also do things
like:
>>> format(42, '->3')
'-42'
But why bother preventing this?
It is unfortunate that %-formatting and .__format__() are different in t
Eric V. Smith added the comment:
Yes, this is the correct bug tracker.
And note that this code isn't mine, I just posted it here so it wouldn't be
lost. It looks like the original message was from
https://mail.python.org/pipermail/python-dev/2010-April/0
Eric V. Smith added the comment:
Thanks for the report, but that example is so large and complicated that it's
difficult for someone not familiar with it to understand what's going on.
If you could simplify it down to the smallest example that duplicates the
problem, then perhap
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue35617>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Steven is correct: your problem is that in the first example you're reading the
header row before you pass the file to DictReader, so the DictReader cannot
know what your columns are named. (Actually, your code uses the second row of
your file as the c
Eric V. Smith added the comment:
Since this is a new feature, it can only be added to 3.8. Adjusting versions
accordingly.
I suggest that if we add this at all, it only be added to __format__, not to
%-formatting.
Any suggestions on a specification for this?
--
components
Eric V. Smith added the comment:
Before a patch is created, we should discuss the behavior that will be
implemented and agree on it. What is your suggestion?
--
___
Python tracker
<https://bugs.python.org/issue35
Eric V. Smith added the comment:
Of course, feel free to create a PR. But the correct place to discuss any new
behavior is on the issue tracker, or maybe on python-ideas, not in a PR.
--
___
Python tracker
<https://bugs.python.org/issue35
Eric V. Smith added the comment:
I haven't looked at this closely yet, but you'll need to at least:
- add tests that the locale-aware formatting is happening
- support decimal
- make sure it works with complex (which it probably does, but needs a test)
And, I think we'll n
Eric V. Smith added the comment:
-v writes to stderr, so this is the expected behavior. Although maybe this
could be better documented.
See issue 18338, where this was briefly discussed and a change was rejected.
Maybe you're looking for -V (uppercase) or --version, which do write to s
Eric V. Smith added the comment:
That's just the way it is with 2.7.
--
___
Python tracker
<https://bugs.python.org/issue35646>
___
___
Python-bugs-list m
Eric V. Smith added the comment:
Namespace packages (PEP 420) predate ModuleSpec (PEP 451). So, I think this
probably happened when 451 was implemented. Maybe Eric Snow recalls?
I say this without having looked at it very deeply.
As to why the namespace package loader is a private class: it
1401 - 1500 of 2699 matches
Mail list logo