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:
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
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
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:
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
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:
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:
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:
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:
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:
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:
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
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:
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
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 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:
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:
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 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
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 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
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 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:
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
New submission from Eric O. LEBIGOT :
The documentation for the statistics package indicates that many of its
functions (like median()) accept iterators. They seem to actually accept
something more convenient, namely iterables.
Thus, iterator could probably be usefully replaced by iterable
Change by M. Eric Irrgang :
--
pull_requests: +16231
pull_request: https://github.com/python/cpython/pull/16648
___
Python tracker
<https://bugs.python.org/issue32
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:
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:
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:
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:
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
&
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:
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
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:
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:
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 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:
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://
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:
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)
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:
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:
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:
This is explicitly mentioned in PEP 572 as being disallowed:
"Due to design constraints in the reference implementation (the symbol table
analyser cannot easily detect when names are re-used between the leftmost
comprehension iterable expression and the
Eric V. Smith added the comment:
Yury: I'm okay with merging. If I recall, you were going to add a comment or
two about the approach (a closure, if I remember correctly).
I think we should backport to 3.8 and 3.7: it's a bug.
--
Eric V. Smith added the comment:
This is a duplicate of issue 36661.
--
nosy: +eric.smith
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Missing dataclass decorator import in dataclasses module docs
__
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38605>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm not sure what can be done with this. The problem is that the decorator
doesn't know what's in the caller's namespace. The type being added is
"typing.Any". If the caller doesn't import typing, then get_type_hints will
Eric V. Smith added the comment:
Yes, it's always guaranteed to be lowercase. I don't think it would hurt to
mention lowercase briefly (like add just one word!).
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
I think this is a reasonable request. It would have to be a 3.9 feature.
Perhaps some code (and tests) can be stolen from poplib.
--
nosy: +eric.smith
stage: -> needs patch
versions: -Python 3.5, Python 3.6, Python 3.7, Python
Eric V. Smith added the comment:
Closed in favor of issue 36661 (which I realize was opened later, but has more
discussion, so I'm using it going forward).
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Eric V. Smith added the comment:
> It is a limitation of f-strings, though. We're not allowed to use
> backslashes within the f-string expression in curly braces.
I've considered relaxing these restrictions, although it's very complicated.
The parser would need to b
Eric V. Smith added the comment:
int.__format__ inherits this from %-formatting, which inherits it from C's
printf.
There's no way we're going to change this at this point: the breakage would be
too great. So, I'm going to reject this.
--
assignee: -> eric.
Eric V. Smith added the comment:
Now that I re-read this, maybe it was a documentation request, not a functional
change? I'd be okay with documenting the existing behavior, so I'll re-open
this and change the type. Patches welcome.
--
components: +Documentation
resolution
Change by Eric V. Smith :
--
title: String format for hexadecimal notation breaks padding with alternative
form -> Clarify numeric padding behavior in string formatting
___
Python tracker
<https://bugs.python.org/issu
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38693>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue38706>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I think using named parameters in the call to __post_init__ is reasonable. It's
currently positional.
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org
Eric V. Smith added the comment:
I don't think that's necessary. We should just document that parameters are
passed by name to __post_init__. This would have to be a 3.9 feature, since
it's not strictly backward compatible.
--
versions: +Python
Change by Eric V. Smith :
--
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue43471>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Eric V. Smith :
--
nosy: +brett.cannon, eric.smith
___
Python tracker
<https://bugs.python.org/issue43477>
___
___
Python-bugs-list mailing list
Unsub
Eric V. Smith added the comment:
"git blame" will help you identify the authors. It looks there are 5 people
involved: Brett, Antoine, Nick, Eric Snow, and Dino.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
Perhaps you could open a documentation bug? I think specific examples of where
the documentation is wrong, and how it could be improved, would be helpful.
Thanks!
--
nosy: +eric.smith
___
Python tracker
<ht
Eric V. Smith added the comment:
I'm leaning toward accepting this on the condition that it only be invoked for
dataclasses where __repr__ was the version generated by @dataclass. And also
that it use the same fields that the generated __repr__ would use (basically
skipping repr=
Eric V. Smith added the comment:
I think we could document where a "quoted string of length 8 characters would
be returned in multiple pieces" occurs. Which API is that?
If we change that, and if we call it an enhancement instead of a bug fix, then
it can't be backported. It
Eric V. Smith added the comment:
You’ve not told us the behavior you see or the behavior you expect, so we can’t
tell if this is a bug in python.
But it’s in all likelihood not a bug. If you want to get help with your code, I
suggest asking on the python-list mailing list or maybe
Eric V. Smith added the comment:
Could you give an example (using a list of callbacks and values or something)
that shows how it's behaving that you think is problematic? That's the part I'm
not understanding. This doesn't have to be a real example, just show what the
us
Eric V. Smith added the comment:
Thanks, that's very helpful. Does this only affect content text?
This should definitely be documented.
As far as changing it, I think the best thing to do is say that if the context
text is less than some size (I don't know, maybe 1MB?) that it
Eric V. Smith added the comment:
I'm going to close this. @xmm: If you can provide more information showing that
this is a bug in Python or its build process, please re-open this issue.
--
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
I think that's good text, once the enhancement is made. But for existing
versions of python, shouldn't we just document that the text might come back in
chunks?
I don't have a feel for what the
New submission from Eric V. Smith :
The idea is that a keyword-only field becomes a keyword-only argument to
__init__().
For the proposal and a discussion, see
https://mail.python.org/archives/list/python-id...@python.org/message/FI6KS4O67XDEIDYOFWCXMDLDOSCNSEYG/
The @dataclass decorator
Eric V. Smith added the comment:
Closing this in favor of issue 43532, which has a slightly elaborated approach.
--
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder: -> Add keyword-only fields to
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +23671
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24909
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
I'm +0.5. Every time this bites me, I apply the same solution, so you're
probably right that str.join should just do the work itself. And it's no doubt
more performant that way, anyway.
And I've probably got some code that's jus
Eric V. Smith added the comment:
I'd add a note to the docs about it, then open a feature request to change the
behavior. You could turn this issue into a documentation fix.
Unfortunately I don't know if there's a core dev who pays attention to the XML
parsers. But I can pr
New submission from Eric V. Smith :
https://docs.python.org/3/library/dataclasses.html#post-init-processing should
mention that if you need to call super().__init__, you should do it in
__post_init__. Dataclasses cannot know what parameters to pass to the super
class's __init__, so y
Eric V. Smith added the comment:
Are you using a 64-bit version of python? What is sys.maxsize?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43
Change by Eric V. Smith :
--
pull_requests: -23730
___
Python tracker
<https://bugs.python.org/issue43558>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
pull_requests: -23731
___
Python tracker
<https://bugs.python.org/issue43558>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
keywords: +easy -patch
stage: patch review -> needs patch
___
Python tracker
<https://bugs.python.org/issue43558>
___
___
Python-
Eric V. Smith added the comment:
The parens are added in fstring_compile_expr at
https://github.com/python/cpython/blob/9feae41c4f04ca27fd2c865807a5caeb50bf4fc4/Parser/string_parser.c#L391
I don't recall if this is really only a "skip leading whitespace" problem, or
if the
Eric V. Smith added the comment:
Same advice as issue 43616: please provide an example we can run.
This most likely a problem with how you're using lxml, and not a bug in python.
But since we can't test it, we can't know for sure.
--
no
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43624>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
If we do anything for float, we should do the same for decimal.Decimal.
--
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
> The syntax is related to that of formatted string literals, but it is less
> sophisticated and, in particular, does not support arbitrary expressions.
That seems fine to me.
--
___
Python tracker
Eric V. Smith added the comment:
New changeset fb1d01b9630b5069fe975f16e07a027d90b89434 by Irit Katriel in
branch 'master':
bpo-31907: [doc] clarify that str.format() does not support arbitrary
expressions (#25053)
https://github.com/python/cpyt
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 9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1 by Miss Islington (bot)
in branch '3.9':
bpo-31907: [doc] clarify that str.format() does not support arbitrary
expressions (GH-25053) (GH-25055)
https://github.com/python/cpyt
Eric V. Smith added the comment:
I agree with Raymond. We can't make a change that would modify existing program
output. Which is unfortunate, but such is life.
And I'd prefer to see groupings of 5 on the right, but I realize I might be in
th
Change by Eric V. Smith :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue43675>
___
___
Python-bugs-list
Eric V. Smith added the comment:
I think it's PyMethod_Type.
--
nosy: +eric.smith, rhettinger
___
Python tracker
<https://bugs.python.org/issue43677>
___
___
New submission from Eric V. Smith :
Please provide example code that we can run which demonstrates the problem.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
I don't see how this would be possible in general. What would you do with a
function call that has side effects?
f'{a()+b+c=}'
?
You'd end up calling a() twice, or inventing your own expression evaluator.
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43697>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm going to close this. I agree with Serhiy that it's pushing f-strings too
far.
If you really want to pursue this, you'll need to specify the semantics much
more clearly, and then bring it up on the python-ideas mailing list. But I
don
Eric V. Smith added the comment:
> ModuleNotFoundError: _curses library not found. Install a supported _curses
> library to use the curses module.
Is installing _curses possible, on any supported platform? Or would a better
message say that curses is not supported on this pl
Eric V. Smith added the comment:
While I wouldn't object to tweaking the message associated with the exception,
I'm not sure it's necessary. Googling "curses modulenotfound" gives a number of
hits that have good information about the issue. Is there really a practi
Eric V. Smith added the comment:
New changeset bdee2a389e4b10e1c0ab65bbd4fd03defe7b2837 by Miss Islington (bot)
in branch '3.8':
bpo-36470: Allow dataclasses.replace() to handle InitVars with default values
(GH-20867) (GH-25201)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 013c30e5fcee449cee63354d34585d6111782c82 by Miss Islington (bot)
in branch '3.9':
bpo-36470: Allow dataclasses.replace() to handle InitVars with default values
(GH-20867) (GH-25200)
https://github.com/python/cpyt
4201 - 4300 of 6702 matches
Mail list logo