Eric V. Smith added the comment:
Oops, make that 80 combinations (I forgot the various 'fb' ones):
['B', 'BF', 'BFR', 'BFr', 'BR', 'BRF', 'BRf', 'Bf', 'BfR', 'Bfr', 'Br',
Eric V. Smith added the comment:
My first attempt. Many more tests are needed.
I'm going to need to spend some time trying to figure out how parts of
tokenize.py actually works. I'm not sure, for example, that endpats is
initialized correctly. There definitely aren't enough te
Changes by Eric V. Smith :
--
title: Use with instead of try finally -> In threading module, use with instead
of try finally
___
Python tracker
<http://bugs.python.org/issu
Changes by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue25363>
___
___
Eric V. Smith added the comment:
Although the function names have changed (I think due to Argument Clinic), the
reported issue still applies to the current code:
https://hg.python.org/cpython/file/tip/PC/msvcrtmodule.c#l309
I'll let other decide if the change is actually desirable. It
Eric V. Smith added the comment:
That's a great test, thanks.
If we were designing this from scratch, I agree that raising an exception is
the right thing to do. But the questions is: can we change the behavior now?
I think it's unlikely that anyone is relying on these functions ret
Changes by Eric V. Smith :
--
title: tokenize: add test for multi-line strings -> tokenize: add tests for
multi-line strings
___
Python tracker
<http://bugs.python.org/issu
New submission from Eric V. Smith:
As part of fixing issue 25311, I'm going to change how the string pattern
recognition works. I want to make sure I don't break anything that currently
works, but there are no tests for multi-line strings. I'll add those first,
under this
Changes by Eric V. Smith :
--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40798/issue-25422.diff
___
Python tracker
<http://bugs.python.org/issu
Eric V. Smith added the comment:
Avoid truncating the expected results when the tokens are long.
--
Added file: http://bugs.python.org/file40799/issue-25422-1.diff
___
Python tracker
<http://bugs.python.org/issue25
Eric V. Smith added the comment:
Removed the truncation of tokens. There's really no point to it, and it could
be hiding bugs.
Also removed the truncation of token names, although none were ever truncated.
--
Added file: http://bugs.python.org/file40800/issue-25422-2
Changes by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eric V. Smith added the comment:
Multi-line string tests were added in changeset 91c44dc35dfd. That will make
changes for this issue safer. Updated patch to come.
--
___
Python tracker
<http://bugs.python.org/issue25
Eric V. Smith added the comment:
This patch cleans up string matching in tokenize.py, and adds f-string support.
--
Added file: http://bugs.python.org/file40821/issue25311-1.diff
___
Python tracker
<http://bugs.python.org/issue25
Eric V. Smith added the comment:
Saksham: First we need our "experts" to decide what, if any, change is needed.
If we decide that a change is needed, at that point we'd look at a patch.
--
___
Python tracker
<http://bugs.pyt
Eric V. Smith added the comment:
Saksham: Also, it would be best to take this discussion of how to produce a
patch to the python-committers mailing list:
https://mail.python.org/mailman/listinfo/python-committers
--
___
Python tracker
<h
Eric V. Smith added the comment:
> Berker Peksag added the comment:
>
>> Also, it would be best to take this discussion of how to produce a patch to
>> the python-committers mailing list:
>
> or the core-mentorship list:
> https://mail.python.org/mailman/listin
Eric V. Smith added the comment:
In what way does the OS crash? Are there any kernel messages? Or is this the
python executable crashing? Again, if so, what messages are printed?
In any event, if this really is an OS crash, then it's a Linux bug and should
be reported to
Eric V. Smith added the comment:
There's a typo here in 'executable':
+ '`{} -m venv`'.format(exeutable), file=sys.stderr)
And this could now be:
print('WARNING: the pyenv script is deprecated in favour of '
f'`{executable} -m venv
Eric V. Smith added the comment:
You should read: https://docs.python.org/3/tutorial/floatingpoint.html
--
components: -Build
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python track
Changes by Eric V. Smith :
--
keywords: -patch
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Eric V. Smith added the comment:
I've fixed this particular problem, but the tokenize module definitely has some
other issues. It recompiles regexes very often when it doesn't need to, it
treats single- and triple-quoted strings differently (leading to some code
bloat), etc.
New submission from Eric V. Smith:
Currently, the f-string f'a{3!r:10}' evaluates to bytecode that does the same
thing as:
''.join(['a', format(repr(3), '10')])
That is, it literally calls the functions format() and repr(). The same holds
t
Eric V. Smith added the comment:
Small cleanups. Fixed a bug in PyCompile_OpcodeStackEffect.
--
Added file: http://bugs.python.org/file40864/format-opcode-1.diff
___
Python tracker
<http://bugs.python.org/issue25
Eric V. Smith added the comment:
This patch addresses Larry's review, plus bumps the bytecode magic number.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Oops. Forgot to include the diff with that last message. But it turns out it
doesn't work, anyway, because I put the #define's in opcode.h, which is
generated (so my code got deleted!).
I'll try to find some reasonable .h file to use and sub
Eric V. Smith added the comment:
Brett: I'll take a look.
Serhiy: I'm looking for a place to put some #defines related to the bit masks
and bit values that my FORMAT_VALUE opcode is using for opargs. One option is
to just put them in Tools/scripts/generate_opcode_h.py, so that they
Eric V. Smith added the comment:
Thanks, Serihy. I looked at those, and neither one is a great fit. But not
having a better option, I went with ceval.h. Here's the patch.
--
Added file: http://bugs.python.org/file40880/format-opcode-2
Eric V. Smith added the comment:
Some formatting improvements.
I removed one of the optimizations I was doing, because it's also done in
PyObject_Format(). I plan on moving other optimizations into PyObject_Format(),
but I'll open a separate issue for that.
I swapped the or
Eric V. Smith added the comment:
Right, they're the same because it's a single bit. You 'and' with a mask to get
the bits you want, and you 'or' together the values. It's an old habit left
over from my bit-twiddling days.
I guess the test could really be:
Eric V. Smith added the comment:
That's an unfortunate implementation choice. I agree we probably can't break
locale.atof, but how about adding another function with a better
implementation, that's strictly locale-aware?
--
no
Eric V. Smith added the comment:
Brett: https://docs.python.org/devguide/compiler.html#introducing-new-bytecode
looks correct (and reminded me to update dis.rst!).
--
resolution: -> fixed
stage: patch review -> resolved
status: open -&g
Eric V. Smith added the comment:
I agree that there's no bug here: the timers are working as expected.
ivb: if you disagree, please explain what behavior you expected, versus what
you see.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
Since f-strings are not constant strings, they cannot be used as docstrings
without some modifications to the compiler.
I'm not sure it's worth evaluating a docstring f-string at compile time to make
them become docstrings: I can't think of a
Eric V. Smith added the comment:
I think the error here is that tokenize returns type=ASYNC for 'async', instead
of type=NAME.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
It does not currently work, because the docstring logic looks for a string, not
an expression. And an f-string is an expression.
It would require changing the compiler to evaluate the f-string expression
Eric V. Smith added the comment:
Oops, wrong issue. Ignore my last comment. I shouldn't do two things at once.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
It does not currently work, because the docstring logic looks for a string, not
an expression. And an f-string is an expression.
It would require changing the compiler to evaluate the f-string expression
Eric V. Smith added the comment:
Assuming David means "it wouldn't be unreasonable to insert a disclaimer", I
agree.
--
___
Python tracker
<http://bugs.pyt
Eric V. Smith added the comment:
D'oh! I read your original comment as "it would be unreasonable to insert a
disclaimer", and then I wondered why you'd used such a convoluted sentence and
reversed your meaning. It's all my fault. Fortunately, I don't think
Eric V. Smith added the comment:
I've been playing around with this. My implementation is basically the naive:
def __getitem__(self, value):
return self.group(value)
I have the following tests passing:
def test_match_getitem(self):
pat = re.compile('(?:(?Pa)|
Eric V. Smith added the comment:
Here's the patch.
I added some more tests, including tests for ''.format_map(). I think the
format_map() tests convince me that keeping None for non-matched groups makes
sense.
--
assignee: -> eric.smith
keywords: +easy, needs r
Eric V. Smith added the comment:
I agree that the proposed change would require a PEP, and this should be
discussed on python-ideas.
I also think there's very little chance such a change would be accepted, but
that doesn't mean it's impossible.
I think using a external libra
Eric V. Smith added the comment:
This is a duplicate of issue 20454.
--
nosy: +eric.smith
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> platform.linux_distribution() returns empty value on Archlinux
an
Eric V. Smith added the comment:
I'd forgotten that issue 25008 is about deprecating SMTPServer (or not, there
are multiple opinions on it).
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Please show us how you're measuring the performance. Also, please show the
output of "python -V".
--
components: +Interpreter Core -Windows
nosy: +eric.smith -paul.moore, steve.dower, tim.golden, zach.ware
___
Eric V. Smith added the comment:
I see a small difference, but I think it's related to the fact that in the
first example you're concatenating 2 strings (',' and the result of {0}), and
in the 2nd example it's 3 strings ("'", {0}, "',"):
Eric V. Smith added the comment:
I believe this is a duplicate of issue 9334. There's a lot of discussion there.
--
nosy: +eric.smith
stage: -> resolved
status: open -> closed
superseder: -> argparse does not accept options taking arguments beginning
with dash (r
Eric V. Smith added the comment:
Agreed. And, since any API change would just be a 3.6+ change, this would
increase the difficulty of moving between 2.7 and 3.x. Which is not something
we want.
--
___
Python tracker
<http://bugs.python.
Eric V. Smith added the comment:
Do you have a pointer to the spec which requires -0 vs.
-3.333e+20, for example?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue26
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue26241>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue26276>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Hi, Mark.
Yes, PEP 3101 is very much under-specified in this area. I tried to avoid the
same mistake in PEP 498, although of course that's a different problem area.
I don't recall why this particular case broke between 3.2.3 and 3.4.3. I'll tr
Changes by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue26287>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
The problem has to do with refcounting when an error occurs. Adjusting the
title accordingly.
I'm not sure yet if the problem is in PyObject_Format(), or in handling errors
in the eval loop when processing FORMAT_VALUE opcodes. I'm slowly tracking it
Eric V. Smith added the comment:
Yes, that's my thinking as well. I'll have a patch soon-ish.
--
___
Python tracker
<http://bugs.python.org/issue26287>
___
__
Eric V. Smith added the comment:
Now I think it's not a refcount problem.
I'm going to switch to POP/PUSH instead of TOP/SET_TOP. I believe the problem
is that I'm not adjusting the top of stack if there's an error.
--
title: Core dump in f-string with form
Eric V. Smith added the comment:
Thanks for the report and the debugging help.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eric V. Smith added the comment:
I agree that the "to xxx" changes look good. And the handful of other
corrections look good, too.
I left a review comment with one typo I found.
--
nosy: +eric.smith
___
Python tracker
<http://bu
Changes by Eric V. Smith :
--
nosy: +brett.cannon, eric.smith, eric.snow, ncoghlan
___
Python tracker
<http://bugs.python.org/issue26344>
___
___
Python-bug
Eric V. Smith added the comment:
Please see https://docs.python.org/3.5/tutorial/floatingpoint.html for a
discussion of why this is not a bug.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_
Eric V. Smith added the comment:
Changing to just 3.6, since that's the only place we could change the behavior.
That said, I'd be -1 on making such a change. It would no doubt break some
existing code.
--
nosy: +eric.smith
type: -> enhancement
versions: -Python 2.
Eric V. Smith added the comment:
I agree that copy2 should not fail because chmod fails. Could you please
provide the entire traceback message when it fails (on both 2.7 and 3.4 or
3.5)? And what OS are you running on, and what filesystem?
It looks like the error happens because errno=95
Eric V. Smith added the comment:
For 3.5 and 2.7, I'd suggest:
format(value, 'x')
or:
format(value, 'X')
Although you might disagree because of the verbosity. But at least you're not
parsing a string at runtime.
And for 3.6 with PEP-498:
f'{value:x}'
Eric V. Smith added the comment:
Without lots of analysis (and disassembly), I can't speak to how valid your
tests are, but they don't seem unreasonable.
format() will always be slower, because it's more general (primarily in that it
can be extended to new types). Plus, it invo
Eric V. Smith added the comment:
> '''
> When no explicit alignment is given, preceding the width field by a zero
> ('0') character enables sign-aware zero-padding for numeric types. This is
> equivalent to a fill character of '0' with an alignmen
Eric V. Smith added the comment:
I agree with David here, this isn't a bug tracker level issue.
But, to the specifics of your example, it already works:
Python 3.6.0a0 (default:9095a5787a82+, Feb 5 2016, 18:24:55)
[GCC 5.2.1 20151010] on linux
Type "help", "copyright&quo
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue26785>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Changing versions.
I left in 2.7, but I doubt we'd make any changes to 2.7 with regards to this.
--
versions: -Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/is
Changes by Eric V. Smith :
--
nosy: +eric.smith
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue26906>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
I'm a native speaker, and it's not the greatest sentence. How about:
All of Python’s immutable built-in objects (such as numbers, strings and
tuples) are hashable. None of its mutable containers (such as lists or
dictionaries) are hashable.
-
Eric V. Smith added the comment:
I think it's okay to change this as far as str.format() goes.
Interestingly enough, the motivating case to add str.format_map() in issue 6081
was exactly this kind of code. Although I notice that the example in that
issue, which it shows as failing, wor
Eric V. Smith added the comment:
Okay. Adding back 3.5 and 2.7, in case someone wants to document the behavior
there. I'm not sure if we fix docs in 3.4 still.
--
versions: +Python 2.7, Python 3.5
___
Python tracker
<http://bugs.py
Eric V. Smith added the comment:
I'm not sure PyObject_GetItem instead of PyDict_GetItem in 3.x completely
explains things, because the code in issue 6081 also works in 2.7.
But I don't think it's terribly important in any event, as long as we
understand the 3.x differe
Eric V. Smith added the comment:
Doesn't namedtuple use _fields (as opposed to _fields_) for a similar purpose?
Would Enum using _order be more consistent with that?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Oops, sorry. I'm an idiot. I was running in a venv where python was python3.
Checking with my installed 2.7.10, I see the expected error.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Yes, I'll read PEP 515 and work on the formatting.
--
___
Python tracker
<http://bugs.python.org/issue26331>
___
___
Pytho
Eric V. Smith added the comment:
See the rejected PEP 351: https://www.python.org/dev/peps/pep-0351/
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue27
Eric V. Smith added the comment:
There's a link in the PEP to the discussion on why it was rejected. There's a
lot to read in the thread (I just spent 30 minutes re-reading it!).
I'm going to close this. If you'd like to re-open the discussion with new
insights, I'd
Changes by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue27078>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
I considered doing this, and have some of it implemented. I discussed it with
Larry Hastings and Mark Shannon at PyCon Ireland, and we decided to just use
''.format() and the new FORMAT_VALUE opcode, since that was the simplest way to
fix th
Eric V. Smith added the comment:
I've created issue 27080 to track the formatting part of this.
--
___
Python tracker
<http://bugs.python.org/issue26331>
___
___
New submission from Eric V. Smith:
I've separated this out from issue 26331, so as to not interfere with
discussions and code reviews for the parsing portion of the PEP.
--
assignee: eric.smith
components: Interpreter Core
messages: 266023
nosy: eric.smith
priority: normal
sev
Changes by Eric V. Smith :
--
nosy: +georg.brandl
___
Python tracker
<http://bugs.python.org/issue27080>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
You'll need to convert the string to bytes first, by using .encode().
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.pyth
Eric V. Smith added the comment:
I agree this isn't a bug, due to per-drive current directories on Windows.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http:
Eric V. Smith added the comment:
I'm not sure it needs fixing: it follows from the definition of using
Decimal(num) / Decimal(denom). Plus, it's controllable with a decimal context:
>>> from decimal import localcontext
>>> with localcontext() as ctx:
... ctx.pr
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23624>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I agree it would be nice to be consistent, and that str.__format__'s approach
is likely the desirable one.
But is it worth the breakage? Surely someone cares about the current behavior.
Does this cause any practical, real-world pr
Eric V. Smith added the comment:
By using %s, you're asking the formatting code to first convert the parameter
to a string. Then, by using .10, you're asking it to truncate the value.
It's essentially equivalent to:
>>> str(-7.7176718e-05)
'-7.7176718e-05
Eric V. Smith added the comment:
I agree with David: It's unfortunate, but too late to change.
FWIW, since the goal is to replace just str.center, I'd write this as:
def my_center(s, width):
return format(s, '^' + str(width))
As soon as you're mixing in other fo
Changes by Eric V. Smith :
--
components: +email -Windows
nosy: +barry, r.david.murray
___
Python tracker
<http://bugs.python.org/issue23727>
___
___
Python-bug
Changes by Eric V. Smith :
--
stage: -> test needed
___
Python tracker
<http://bugs.python.org/issue23779>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23779>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
What's the motivating use case for this?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23910>
___
___
Eric V. Smith added the comment:
Have you thought of just exposing Object/structseq.c?
Before you put much time into this, I'd get Raymond's acceptance of whatever
approach you want to take. It might be best to raise it on py
Eric V. Smith added the comment:
I haven't seen thought it through, just that it seems very similar to a C
namedtuple.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Looks good to me.
I realize it's trivial, but is it worth putting this on PyPI for older 3.x's?
--
___
Python tracker
<http://bugs.python.o
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I think Serhiy is saying that you don't need to implement future_builtins in
3.x, if your 2.7 and 3.x compatible code catches the ImportError.
--
___
Python tracker
<http://bugs.python.org/is
2501 - 2600 of 2699 matches
Mail list logo