Eric V. Smith added the comment:
For future reference:
Specifically, note that:
'' in '' == ''
is equivalent to:
('' in '') and ('' == '')
--
nosy: +eric.smith
resolution: works for me -> not a bug
___
Eric V. Smith added the comment:
Thanks, Serhiy. This has been reported in 24260, so I'm closing this issue.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> TabError behavior doesn't match documentat
Eric V. Smith added the comment:
I can verify this on 3.7.4.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38496>
___
___
Python-bug
Eric V. Smith added the comment:
When you assign to self.num, you're creating an instance variable which hides
the class variable. Instead, assign directly to the class variable:
class D:
num = 0
def __init__(self):
D.num += 1
print('D num', self.num)
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue38462>
___
___
Eric V. Smith added the comment:
I'm not seeing this in either the master or 3.5 branches. Perhaps this is being
done locally by your browser?
Unfortunately I can't find a way for github to link to a specific line in a
.rst file, but when I look at the source code and
https://
Eric V. Smith added the comment:
I don't think it's any more precise. It just seems verbose and confusing to me,
while conveying the same information.
`[arg [arg ...]]` to me means "optionally, an arg followed by one or more
optional args".
While `[arg ...]` to me me
Eric V. Smith added the comment:
Thanks. I'm always looking for ways to make dataclasses easier to use, while
keeping within the original goals. I'll close this for now.
--
resolution: -> wont fix
stage: -> resolved
status
Eric V. Smith added the comment:
I'll try and think of something better.
I know I'm guilty of sending to python-ideas all the time, but discussing
proposed design decisions like this are what that list is all about.
If you want to bring it up there, I'd focus on mak
Eric V. Smith added the comment:
Doesn't __post_init__ address this use case?
--
___
Python tracker
<https://bugs.python.org/issue38444>
___
___
Pytho
Eric V. Smith added the comment:
This would be a 3.9 feature only, so changing the versions.
--
versions: -Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue38
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38444>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
I think [arg ...] would make sense.
Removing 3.5 and 3.6, since they're in security only mode. Adding 3.9.
--
nosy: +eric.smith
versions: +Python 3.9 -Python 3.5, Python 3.6
___
Python tracker
&
Eric V. Smith added the comment:
Okay, then I'll close this.
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.p
Eric V. Smith added the comment:
Yes, that does work:
>>> urllib.parse.urlunparse(("http", f"{host}:{port}", "/", "", "", ""))
'http://hostname:1234/'
The only problem is that your code now needs to look like
&
Eric V. Smith added the comment:
One way I can think of doing this in a backward compatible way is to add
keyword parameters to urlunparse, like:
def urlunparse(components, *, username=None, password=None, hostname=None,
port=None):
Which would make your call:
site_to_test
Eric V. Smith added the comment:
Note that those strings are not docstrings, per se. They're just strings, and
aren't available in the class definition for the dataclass decorator to see.
It's really no different from:
class X:
x: int
3
That 3 just gets evaluated
Eric V. Smith added the comment:
Thank you for your contribution, @iomintz, but I'm not going to accept this
change. I don't think it improves the clarity of the code. And I realize this
is wholly a subjective decision, and others may disagree. But to me, looking at
the table
Eric V. Smith added the comment:
I don't see that as an improvement, especially when the goal is to not change
any functionality.
But maybe I'm just used to truth tables. To me, the truth table makes it clear
that each case is handled correctly.
--
assignee: -> er
Eric V. Smith added the comment:
>> I definitely think we should not modify any code in the stdlib just to
>> switch to f-strings.
> Does this also apply to updating code to use f-strings in an area that's
> already being modified for a functional purpose?
No.
Eric V. Smith added the comment:
I definitely think we should not modify any code in the stdlib just to switch
to f-strings.
I think the code examples in the docs would benefit from a consistent style,
and since f-strings are the least verbose way to format strings, I'd endorse
using
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue36470>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
I think PEP 8 should say "Module-level imports are always put at the top of the
file, ...".
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
Have you tried this on Windows or macOS?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38228>
___
___
Eric V. Smith added the comment:
I'm also -0 on it. It's up to Antoine.
--
___
Python tracker
<https://bugs.python.org/issue38222>
___
___
Python-b
Eric V. Smith added the comment:
I don't think anyone is suggesting reverting the decision on object.__format__.
That decision should stay.
I think the suggestion is to add Path.__format__, which just converts to a
string and formats with the given spec.
Unless someone can think
Eric V. Smith added the comment:
Correct: this change was made specifically so that objects could add their own
format specifiers at a later time. If I recall correctly, This change was
precipitated by wanting to add datetime.__format__: this change broke existing
uses for format() that
Eric V. Smith added the comment:
I agree with Serhiy that !s solves the problem. But as a convenience it might
be nice to add __format__. This issue pops up from time to time on Path and
other types, and I don't think !s is very discoverable. Especially because
formatting works w
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
New changeset c47c8ba2969c9faf1c036b3dc4b0a5cf0d3aa0cc by Eric V. Smith (Miss
Islington (bot)) in branch '2.7':
bpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16236)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 8b907a8875d1b22d8f060dee9430cc82d471e86b by Eric V. Smith (Miss
Islington (bot)) in branch '3.7':
bpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16235)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 7a2f68776a77c782c0abf40dc9e3fb687787e730 by Eric V. Smith (Miss
Islington (bot)) in branch '3.8':
bpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16234)
https://github.com/python/cpyt
Eric V. Smith added the comment:
This is almost certainly not a bug in Python. This forum is for reporting bugs
in Python, not for getting help on using Python. I suggest you try the
python-tutor mailing list: https://mail.python.org/mailman/listinfo/tutor
--
nosy: +eric.smith
Eric V. Smith added the comment:
This forum is for reporting bugs in python, not for getting help with writing
python programs.
I suggest you ask about this on the python-tutor mailing list:
https://mail.python.org/mailman/listinfo/tutor
Good luck!
--
nosy: +eric.smith
resolution
Eric V. Smith added the comment:
Can you provide the code that caused the segfault?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38
Eric V. Smith added the comment:
When you convert the integer to a float (because of the 'f' in the first format
spec), you're losing precision. See:
https://docs.python.org/3/tutorial/floatingpoint.html and
https://docs.python.org/3/faq/design.html#why-are-floating-point-
Eric V. Smith added the comment:
It's turtle.circle:
https://docs.python.org/3.5/library/turtle.html#turtle.circle
@Yehuda: this isn't the appropriate place for help on how the turtle module
works. Please consider the python-tutor list. See
https://mail.python.org/mailman/list
Eric V. Smith added the comment:
I agree that we should close this and not implement a function to draw a circle
centered on the turtle. The fundamental abstraction with turtle graphics is
that the turtle is holding a pen. To have the pen draw elsewhere, where the
turtle does not go, breaks
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue37948>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
The lexer sees an f-string:
f'some text {something.split('
next to a normal string:
')}'
The first of those is not a valid f-string because of the unmatched left brace,
so it's an error.
I'm contemplating making the f-strin
Eric V. Smith added the comment:
I think I'd prefer "... Python uses the usual flow control statements known
from other languages ..."
It's not just syntax, after all.
--
keywords: +newcomer friendly
nosy: +eric.smith
st
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
New changeset b0f4dab8735f692bcfedcf0fa9a25e238a554bab by Eric V. Smith in
branch 'master':
bpo-37868: Improve is_dataclass for instances. (GH-15325)
https://github.com/python/cpython/commit/b0f4dab8735f692bcfedcf0fa9a25e
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +15042
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/15325
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
I think Serhiy means 1.e-8 is not valid.
The spec says that at least one digit is required in the "frac" part, after the
decimal.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
Yeah, I agree it's not an awesome design to work with classes or instances, but
it's documented that way. As soon as I write some tests I'll check this in.
--
___
Python tracker
<https://bugs.pyt
Eric V. Smith added the comment:
I'm guessing I'm looking up the attribute on the instance, not the class.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37868>
___
___
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:
Change by Eric V. Smith :
--
components: +Interpreter Core
type: -> crash
___
Python tracker
<https://bugs.python.org/issue37830>
___
___
Python-bugs-list mai
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 &
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:
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
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:
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
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:
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:
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:
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 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:
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:
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)
>>
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:
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
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:
'\.' 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:
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:
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
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:
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/issue37501>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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:
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:
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'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
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:
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
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:
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:
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:
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
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:
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
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:
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:
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:
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:
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:
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:
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:
And what is your expected result, and why?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37227>
___
___
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:
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:
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:
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:
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:
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:
Thanks for the PR!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.python
Eric V. Smith added the comment:
New changeset 01ee12ba35a333e8a6a25c4153c4a21838e9585c by Eric V. Smith
(Augusto Hack) in branch 'master':
bpo-33569 Preserve type information with dataclasses.InitVar (GH-8927)
https://github.com/python/cpython/commit/01ee12ba35a333e8a6a25c4153c4a2
1201 - 1300 of 2699 matches
Mail list logo