Eric V. Smith added the comment:
I think exposing _NamespaceLoader as NamespaceLoader and registering the ABC
make sense. That would make this in to a feature request for 3.8.
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue35710>
___
__
Eric V. Smith added the comment:
I assume this is on Windows? 0xc374 is a heap corruption error on Windows.
I agree that without a way to reproduce this it will be impossible to track
down any error.
--
nosy: +eric.smith
___
Python tracker
Eric V. Smith added the comment:
What would the interaction be between other_instance and changes? Why is this
API different from .replace()?
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
I agree that I don't see the point, unless there's something I'm missing with
other_instance. Or maybe the proposal is for it to also work with frozen
dataclasses? I'm definitely -1 on that.
So unless there's something I'm
Eric V. Smith added the comment:
This is why I prefer the API exposed by https://pypi.org/project/toposort/
list(toposort({2: {11},
9: {11, 8, 10},
10: {11, 3},
11: {7, 5},
8: {7, 3},
}))
returns [{3, 5, 7}, {8, 11
Eric V. Smith added the comment:
I agree that the current behavior makes sense. I think "preserve the literal
value of the next character" means the space won't be interpreted as a
separator.
In the first example (I think better written as shlex.split(r'a \ b'
Eric V. Smith added the comment:
>From the documentation of IPv4Address:
The following constitutes a valid IPv4 address:
1. A string in decimal-dot notation, consisting of four decimal integers in the
inclusive range 0–255, separated by dots (e.g. 192.168.0.1). Each integer
represents
Change by Eric V. Smith :
--
nosy: +eric.smith, lukasz.langa
___
Python tracker
<https://bugs.python.org/issue35834>
___
___
Python-bugs-list mailing list
Unsub
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue35960>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
New changeset b01786c8812c4cc24dd561b5941025bdd6f444c0 by Eric V. Smith
(Christopher Hunt) in branch 'master':
bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 0a834c18cdafa5447d4436878e64aa7a4e4dc817 by Eric V. Smith (Miss
Islington (bot)) in branch '3.7':
bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)
(GH-11826)
https://github.com/python/cpyt
Eric V. Smith added the comment:
Thanks for the patch!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
I suspect Nathan is seeing this problem at class scope. This is a well known
issue:
>>> class C:
... from random import random
... out = [random() for ind in range(3)]
...
Traceback (most recent call last):
File "", line 1, in
Fi
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue36077>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
I'm not keen on re-ordering parameters. Maybe it could be done if specified
with a parameter to @dataclass.
--
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
--
Eric.
> On Mar 3, 2017, at 6:36 AM, Bernhard M. Wiedemann
> wrote:
>
>
> New submission from Bernhard M. Wiedemann:
>
> See https://reproducible-builds.org/ and
> https://reproducible-builds.org/docs/buy-in/ for why this is a
Eric V. Smith added the comment:
The examples don't cover it, but look at the documentation for setting
arbitrary mail headers such as CC.
And look at smtplib.SMTP.sendmail() on sending a message to arbitrary
recipients (to, cc, or bcc are all the same):
https://docs.python.org/2/li
Eric V. Smith added the comment:
So, you want to improve the examples? I wouldn't be opposed to that. I don't
see that there's any code to change.
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
___
Pyt
Eric V. Smith added the comment:
You need to review how SMTP works. The contents of the mail message have no
bearing on where messages are sent. That's exactly how BCC works: there's
nothing in the message telling you who is BCC'd, but the mail is still sent to
the BCC recip
Eric V. Smith added the comment:
No, we won't be adding new features to 2.7. Sorry.
--
nosy: +eric.smith
resolution: -> rejected
stage: -> resolved
type: -> enhancement
___
Python tracker
<http://bugs.pyth
Changes by Eric V. Smith :
--
resolution: rejected ->
stage: resolved -> needs patch
___
Python tracker
<http://bugs.python.org/issue29777>
___
___
Pyth
Eric V. Smith added the comment:
Yes, I think it can be closed. Thanks!
--
___
Python tracker
<http://bugs.python.org/issue28739>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
I agree this needs to be different from replace(), due to not being atomic.
That makes it an enhancement, so I'm removing 3.5.
I'm +1 on Path supporting something like shutil.move().
--
nosy: +eric.smith
type: -> enhancement
versions:
Eric V. Smith added the comment:
Serhiy: I plan to find time in the next week or so to look at this. Sorry for
the delay. Plus, the new workflow isn't helping me out: I need to get up to
speed on it.
--
___
Python tracker
<http://bugs.py
Eric V. Smith added the comment:
This would be an issue for pscyopg2 support, not the Python bug tracker.
You're probably using an unsupported combination of psycopg2 and postgres
libraries.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
+1: gets the job done without complicating the API.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue29
Eric V. Smith added the comment:
This should be easy enough to fix, at least in IPv4Interface.__init__. It needs
to copy some of IPv4Network.__init__, dealing with address[1] and calling
_make_netmask(). Currently, it just calls int(address[1]).
I haven't looked at IPv6Interface.
Test
Eric V. Smith added the comment:
While an IPv4Interface may be a subclass of an IPv4Address, it definitely has
more information attached to it: the netmask of the network it's on. So an
interface (like a network) needs to allow additional parameters to specify the
netmask.
It should be
Eric V. Smith added the comment:
Thanks! Yes, we'll need tests.
I'm out of town most of the weekend, but I'll look at this as soon as I can.
--
___
Python tracker
<http://bugs.pyt
Eric V. Smith added the comment:
Just a guess, but it's because this code was written at a time when subclassing
was the preferred way to extend code. Now we know better :), but it's not
possible to change history, unfortunately. Lots of code depends on the current
behavior.
If
Eric V. Smith added the comment:
Short of a compelling use case, I suggest we reject this enhancement request.
len() was deliberately not added in #24454. It's not like any normal code would
be iterating over match groups.
--
nosy: +eric.
Eric V. Smith added the comment:
That's consistent with the example: it's showing you how to create a list of
functions, that when called, return squares.
"This gives you a list that contains 5 lambdas that calculate x**2"
Maybe "squares" isn't the most aw
Changes by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30023>
___
___
Eric V. Smith added the comment:
I think these are reasonable improvements. Also, move the initialization of
"silent" in to __new__.
--
keywords: +easy
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
Oops, yes, __init__.
Plenty of the demos use imports. I think it would be clearer with argparse, but
I also don't feel strongly about it.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30090>
___
___
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue30104>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I think the example is correct. Because baz's action is store_false, the
default is True. So if baz is omitted, it should have a True value. That's what
the example shows, and what I see when I run this code.
Can you show what you tested, what yo
Eric V. Smith added the comment:
I agree we shouldn't do anything heroic to "fix" dtoa.c. I'd wait and see if
Gay (or other maintainers) will chose an approach if Clang keeps this behavior.
At most, I think Mark's idea to use -fno-strict-aliasing only on dtoa.c and
Eric V. Smith added the comment:
> Unfortunately, as far as I know, clang still does not support
> function-level optimization pragmas. Maybe it was implemented
> recently, but then you would still have to have a workaround>
> for older versions.
I realize the answer is probably
Eric V. Smith added the comment:
The Unix "od" command pretty much has all of the possibilities covered.
https://linuxconfig.org/od-1-manual-page
Although "named characters" might be going a bit far. Float, too.
--
___
P
Eric V. Smith added the comment:
I'm okay with this change.
--
___
Python tracker
<http://bugs.python.org/issue28974>
___
___
Python-bugs-list mailing list
Eric V. Smith added the comment:
This is on my list of things to review at PyCon, when I should finally have
some free time.
--
___
Python tracker
<http://bugs.python.org/issue29
Eric V. Smith added the comment:
There's no particular reason, we just weren't careful about enforcing a
consistent style, especially on older code.
But whatever the reason, it's now too late to change this.
--
nosy: +eric.smith
resolution: -> wont fix
stage:
Eric V. Smith added the comment:
We won't do that, because then we'd have two functions that do the same thing.
There's no sense having to learn two functions, just to achieve consistency.
Sorry.
--
___
Python tracker
<http
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue30590>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
You'll need to be careful about fully translating to python 3, though. What do
you do with:
print >> sys.stderr, "message"
or:
print "message",
?
--
nosy: +eric.smith
___
Python t
Eric V. Smith added the comment:
Sorry, I've been busy. I'll get to this soon, though.
--
___
Python tracker
<http://bugs.python.org/issue30529>
___
___
Eric V. Smith added the comment:
That sounds good to me.
Just to elaborate on my earlier message, since it might have been too terse:
I think it would be misleading to give in error at:
print >>sys.stderr, "message"
and say:
Did you mean 'print("message")'
Eric V. Smith added the comment:
-1. We don't want to have objects that are orderable depending on their values.
I can't think of anywhere else we do this.
It would be very easy to have a complex == 42+0.001j, after some
calculation. This near-zero imaginary part would preve
Eric V. Smith added the comment:
I'm finally getting time to look at this. I'll see what I can do.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
>> I should have to start that package somehow.
>
> `pip install` is a pretty good opt-in already imo
I think that’s where we disagree. Like others, I don’t want this to affect
every python script in a given installation.
>> Instea
Eric V. Smith added the comment:
While I think this might have been a reasonable choice when this was first
added, I think it's too late to change. We'd have to keep the files in bin (or
Scripts) indefinitely because there are a zillion tutorials that talk about
them. And havi
Eric V. Smith added the comment:
I agree we should close this.
--
___
Python tracker
<https://bugs.python.org/issue11644>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
I agree that this is not a useful check.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36384>
___
___
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue36424>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
Please provide the exact code to duplicate the problem.
I suspect this is a problem with your code, not with str.strip and not with
Windows.
--
nosy: +eric.smith
status: open -> pending
___
Python tracker
<
Eric V. Smith added the comment:
I think it should be 3.8 only, and the docs should be updated. Apologies for
not catching that earlier: I searched via Google, which was a mistake.
--
___
Python tracker
<https://bugs.python.org/issue36
Eric V. Smith added the comment:
I cannot run that example on my computer.
Please reduce this to a single line of code, with no imports, that calls
.strip() and shows your problem. Ideally you will just use constants, and not
computed strings.
Something like:
>>> 'mage
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36480>
___
___
Eric V. Smith added the comment:
I'm not sure what you're asking here. You're comparing the result of the print
function to a value. Print returns None, so it doesn't compare equal to any of
the values you're comparing it to.
To see what's happening, try:
>
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36524>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm not sure why dataclasses would be different here:
>>> import dataclasses
>>> import unittest.mock
>>> @dataclasses.dataclass
... class Foo:
... name: str
... baz: float
... bar: int = 12
...
>>> import
Eric V. Smith added the comment:
Python makes no guarantee as to whether an identity test on integers would
return True or False. You should not depend on the behavior in any particular
version.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status
Eric V. Smith added the comment:
ensurepip does not access the network, by design. We do not want it to start
access the network without a lot of discussion.
And if it does access the network, it will need to be able to use alternate
URLs. For example: where I deploy Python, it would not
Eric V. Smith added the comment:
And I don't mean to sound like a total downer. I just think it's important that
we recognize all of the use cases.
Thanks for your work on this.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
nosy: +eric.smith, mark.dickinson, skrah
___
Python tracker
<https://bugs.python.org/issue36622>
___
___
Python-bugs-list mailin
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
Also see https://docs.python.org/3/tutorial/floatingpoint.html for some
Python-specific details.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36
Eric V. Smith added the comment:
I think adding "from dataclasses import dataclass" in the first example is fine.
There's a similar import in the sqlite3 documentation, just to pick one at
random.
--
___
Python tracker
<https
Eric V. Smith added the comment:
I think the best thing to do is write another decorator that adds this method.
I've often thought that having a dataclasses_tools third-party module would be
a good idea. It could include my add_slots decorator in
https://github.com/ericvsmith/datacl
Eric V. Smith added the comment:
I assume the OP is using the stdlib parser module just to show what is a syntax
error and what isn't. But most of the characters in the example strings aren't
required, so it can be simplified.
Here is a simpler case demonstrating what I think
Eric V. Smith added the comment:
I won't discourage anyone from making such changes, but I don't think it's a
real problem. I haven't seen that people are confused about needing to import
the module being discussed in the documentation. I don't think there's any
Eric V. Smith added the comment:
I definitely think any missing import from typing should be added.
--
___
Python tracker
<https://bugs.python.org/issue36
Eric V. Smith added the comment:
I think this is correct. The documentation says globals is "the function’s
module globals". I suggest closing this as not a bug.
https://docs.python.org/3/library/inspect.html#inspect.getclosurevars
--
nosy: +eric.smith
status: open ->
Eric V. Smith added the comment:
That is interesting. See these examples. I'm starting a new interpreter each
time:
>>> import inspect
>>> def abc(): pass
...
>>> inspect.getclosurevars(abc)
ClosureVars(nonlocals={}, globals={}, builtins={}, unbound=set())
Eric V. Smith added the comment:
pprint.pprint is not designed to be a drop-in replacement for print. At this
point, we cannot break existing code to change how pprint works.
I suggest you make a pprint.pprint wrapper that does what you want, or maybe
subclass pprint.PrettyPrinter
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36723>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm not sure where (or if) it's defined in the Python docs, but in PEP 3101
it's in
https://www.python.org/dev/peps/pep-3101/#simple-and-compound-field-names: "It
should be noted that the use of 'getitem' within a format string
Eric V. Smith added the comment:
Agreed on closing this and discussing it at issue 34717.
(I can't get bpo to accept this because of the comma in "Oliver Too, Eh?", so
I'm removing them temporarily. Will try to add back, but might fail.)
--
nosy: +eric.s
Eric V. Smith added the comment:
I notified "Oliver Too, Eh?" by email directly about being dropped from this
issue due to the comma in the username.
xtreak: you seemed to be able to add a message while keeping "Oliver Too, Eh?"
on the
Eric V. Smith added the comment:
I created https://github.com/python/bugs.python.org/issues/35 about the comma
in the username.
--
___
Python tracker
<https://bugs.python.org/issue36
Eric V. Smith added the comment:
This is a duplicate of issue 14905.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36740>
___
___
Pytho
Eric V. Smith added the comment:
I don't think this is a problem. There are plenty of things allowed by Python's
grammar that are converted to errors in subsequent passes. For example:
>>> *[1]
File "", line 1
SyntaxError: can't use starred e
Eric V. Smith added the comment:
Thanks, Serhiy.
I suppose that we could add a note to the documentation, but I'm not sure it
would be worth the confusion it would create. It's best to think of this is
"it's just an expression, like everywhere else in Python". If
Eric V. Smith added the comment:
The 90% use case with dataclasses is satisfied with just "@dataclass", and
perhaps the target user there is less sophisticated.
But the main difference between @dataclass and @lru_cache is that all of the
parameters to @dataclass are keyword-onl
New submission from Eric V. Smith :
I originally propsed this here:
https://mail.python.org/pipermail/python-ideas/2018-October/053956.html, and
there has also been some discussion on discourse.
The proposal is to add a !d "type conversion" to f-strings, to make for simpler
&q
Eric V. Smith added the comment:
I support a general mechanism. But I think that if it's much more than the 2
characters that this would take, then I don't want to use it for f-strings. The
whole point here (as with all f-string features) is a concise way to get the
string yo
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +12976
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
Re: format specs and what they apply to.
The problem is that you want f"{expr!d}" to expand to f"expr={repr(expr)}". And
I think you want that because it's the most useful behavior for strings.
Without the repr it's not very use
Eric V. Smith added the comment:
The most recent version of the patch implements the conditional repr/format
behavior. I'm pretty happy with it.
Other than docs, I think this is done. I'm going to discuss it with a few more
people at PyCon, then commit it.
There's a slight o
Eric V. Smith added the comment:
!= would be my preference, but it can't work. f'{0!=1}' is already legal.
I'm not crazy about !!. I think that will be too confusing.
--
___
Python tracker
<https://bug
Eric V. Smith added the comment:
This behavior isn't going to change. As Zach says, if you want to convert any
value to a string, use !s. We want to fail as soon as possible: if a class
(such as NoneType) doesn't implement __format__, then trying to format an
instance with a f
Eric V. Smith added the comment:
Serhiy's point about how special this is is very valid. It's so special that I
can't figure out where to document it. f-strings are really only documented in
Doc/reference/lexical_analysis.rst, and !d details, especially the format/repr
dis
Eric V. Smith added the comment:
And for those who *really* want to be able to apply a format spec to the result
of the entire !d expression, you can always use nested f-strings:
>>> for x in [3.1415, 0.5772156649, 100]:
... print(f'{f"{x!d:.1f}":*^20}')
...
New submission from Eric V. Smith :
The walrus operator breaks f-strings, because the f-string scanner sees the
colon as the end of the expression.
>>> x = '10'
>>> f'{x:=10}'
Traceback (most recent call last):
File "", line 1, in
ValueE
Eric V. Smith added the comment:
f-strings are not going to take a position on what a "good" expression is, and
what is and isn't allowed. If it's a Python expression that could possibly be
parsed in the f-string context, f-strings will allow it. This is clearly a bug
in
Eric V. Smith added the comment:
Correct about the parens. I'm just going to fix it a the top level, without
parens. There's no reason it shouldn't work, the fact that it doesn't work now
is just an accident of implementation.
I'll fix it by adding a special test, t
Eric V. Smith added the comment:
The fact that adding := support could break existing working code does give me
pause to make any change here, and does suggest that a deprecation period would
be needed in order to modify the f-string expression scanning behavior.
One concern I have is that
1501 - 1600 of 2699 matches
Mail list logo