[issue25311] Add f-string support to tokenize.py

2015-10-09 Thread Eric V. Smith
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', &#x

[issue25311] Add f-string support to tokenize.py

2015-10-09 Thread Eric V. Smith
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

[issue25362] In threading module, use with instead of try finally

2015-10-10 Thread Eric V. Smith
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

[issue25363] x=[1,2,3].append([1,2,3]) bug

2015-10-10 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue25363> ___ ___

[issue25386] msvcrt_putch/msvcrt_putwch don't check the return value of _putch/_putwch

2015-10-13 Thread Eric V. Smith
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

[issue25386] msvcrt_putch/msvcrt_putwch don't check the return value of _putch/_putwch

2015-10-15 Thread Eric V. Smith
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

[issue25422] tokenize: add tests for multi-line strings

2015-10-16 Thread Eric V. Smith
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

[issue25422] tokenize: add test for multi-line strings

2015-10-16 Thread Eric V. Smith
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

[issue25422] tokenize: add tests for multi-line strings

2015-10-16 Thread Eric V. Smith
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

[issue25422] tokenize: add tests for multi-line strings

2015-10-16 Thread Eric V. Smith
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

[issue25422] tokenize: add tests for multi-line strings

2015-10-16 Thread Eric V. Smith
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

[issue25422] tokenize: add tests for multi-line strings

2015-10-16 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue25311] Add f-string support to tokenize.py

2015-10-16 Thread Eric V. Smith
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

[issue25311] Add f-string support to tokenize.py

2015-10-20 Thread Eric V. Smith
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

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
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

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
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

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
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

[issue25465] Pickle uses O(n) memory overhead

2015-10-25 Thread Eric V. Smith
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

[issue25154] Drop the pyvenv script

2015-10-26 Thread Eric V. Smith
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

[issue25480] string format in large number

2015-10-26 Thread Eric V. Smith
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

[issue25311] Add f-string support to tokenize.py

2015-10-26 Thread Eric V. Smith
Changes by Eric V. Smith : -- keywords: -patch stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue25311] Add f-string support to tokenize.py

2015-10-26 Thread Eric V. Smith
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.

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Eric V. Smith
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:

[issue25543] locale.atof keep '.' even if not part of the localeconv

2015-11-03 Thread Eric V. Smith
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

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-03 Thread Eric V. Smith
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

[issue25561] unstable result of time.monotonic

2015-11-05 Thread Eric V. Smith
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

[issue25179] PEP 498 f-strings need to be documented

2015-11-07 Thread Eric V. Smith
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

[issue25579] def is not a keyword with tokenize.py

2015-11-07 Thread Eric V. Smith
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

[issue25579] def is not a keyword with tokenize.py

2015-11-07 Thread Eric V. Smith
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

[issue25579] def is not a keyword with tokenize.py

2015-11-07 Thread Eric V. Smith
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

[issue25179] PEP 498 f-strings need to be documented

2015-11-07 Thread Eric V. Smith
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

[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith
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

[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith
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

[issue24454] Improve the usability of the match object named group API

2015-12-06 Thread Eric V. Smith
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)|

[issue24454] Improve the usability of the match object named group API

2015-12-07 Thread Eric V. Smith
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

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-17 Thread Eric V. Smith
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

[issue26008] Different behaviour platform.linux_distribution() on Python2.7.11 and 3.5.1

2016-01-04 Thread Eric V. Smith
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

[issue26036] Unnecessary arguments on smtpd.SMTPServer

2016-01-12 Thread Eric V. Smith
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

[issue26118] String performance issue using single quotes

2016-01-14 Thread Eric V. Smith
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 ___

[issue26118] String performance issue using single quotes

2016-01-14 Thread Eric V. Smith
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}, "',"):

[issue26196] Argparse breaks when a switch is given an argument beginning with a dash

2016-01-25 Thread Eric V. Smith
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

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Eric V. Smith
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.

[issue26229] Make number serialization ES6/V8 compatible

2016-01-29 Thread Eric V. Smith
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

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue26241> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue26276> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Eric V. Smith
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

[issue26287] Core dump in f-string with lambda and format specification

2016-02-05 Thread Eric V. Smith
Changes by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <http://bugs.python.org/issue26287> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26287] Core dump in f-string with formatting errors due to refcount bug

2016-02-05 Thread Eric V. Smith
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

[issue26287] Core dump in f-string with formatting errors due to refcount bug

2016-02-05 Thread Eric V. Smith
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> ___ __

[issue26287] Core dump in f-string with formatting errors

2016-02-05 Thread Eric V. Smith
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

[issue26287] Core dump in f-string with formatting errors

2016-02-05 Thread Eric V. Smith
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

[issue26304] Fix “allows to ” in documentation

2016-02-08 Thread Eric V. Smith
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

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +brett.cannon, eric.smith, eric.snow, ncoghlan ___ Python tracker <http://bugs.python.org/issue26344> ___ ___ Python-bug

[issue26422] printing 1e23 and up is incorrect

2016-02-23 Thread Eric V. Smith
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 _

[issue26429] os.path.dirname returns empty string instead of "." when file is in current directory

2016-02-24 Thread Eric V. Smith
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.

[issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod

2016-03-02 Thread Eric V. Smith
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

[issue26506] hex() documentation: mention "%x" % int

2016-03-07 Thread Eric V. Smith
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}'

[issue26506] hex() documentation: mention "%x" % int

2016-03-09 Thread Eric V. Smith
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

[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-19 Thread Eric V. Smith
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

[issue26713] Change f-literal grammar so that escaping isn’t possible or necessary

2016-04-08 Thread Eric V. Smith
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

[issue26785] repr of -nan value should contain the sign

2016-04-16 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue26785> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26785] repr of -nan value should contain the sign

2016-04-16 Thread Eric V. Smith
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

[issue26906] format(object.__reduce__) fails intermittently

2016-05-02 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith type: -> behavior ___ Python tracker <http://bugs.python.org/issue26906> ___ ___ Python-bugs-list mai

[issue26947] Documentation improvement needed

2016-05-04 Thread Eric V. Smith
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. -

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith
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

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith
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

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Eric V. Smith
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

[issue26981] add compatibility shim for enum34 backport

2016-05-08 Thread Eric V. Smith
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

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-09 Thread Eric V. Smith
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

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-05-15 Thread Eric V. Smith
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

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread Eric V. Smith
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

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-21 Thread Eric V. Smith
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

[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Eric V. Smith
Changes by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <http://bugs.python.org/issue27078> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-05-21 Thread Eric V. Smith
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

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-05-21 Thread Eric V. Smith
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> ___ ___

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-05-21 Thread Eric V. Smith
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

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-05-21 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +georg.brandl ___ Python tracker <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27087] unable to use socket send and sendall due to type error

2016-05-22 Thread Eric V. Smith
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

[issue23535] os.path.join() wrong concatenation of "C:" on Windows

2015-02-27 Thread Eric V. Smith
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:

[issue23602] Implement __format__ for Fraction

2015-03-08 Thread Eric V. Smith
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

[issue23624] str.center inconsistent with format "^"

2015-03-10 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue23624> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23624] str.center inconsistent with format "^"

2015-03-10 Thread Eric V. Smith
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

[issue23627] Incorrect string formatting of float values in Python 2.7

2015-03-10 Thread Eric V. Smith
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

[issue23624] str.center inconsistent with format "^"

2015-03-18 Thread Eric V. Smith
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

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Eric V. Smith
Changes by Eric V. Smith : -- components: +email -Windows nosy: +barry, r.david.murray ___ Python tracker <http://bugs.python.org/issue23727> ___ ___ Python-bug

[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort

2015-03-25 Thread Eric V. Smith
Changes by Eric V. Smith : -- stage: -> test needed ___ Python tracker <http://bugs.python.org/issue23779> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort

2015-03-25 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue23779> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: What's the motivating use case for this? -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue23910> ___ ___

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
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

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
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

[issue23893] Forward-port future_builtins

2015-04-08 Thread Eric V. Smith
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

[issue16991] Add OrderedDict written in C

2015-04-08 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23893] Forward-port future_builtins

2015-04-09 Thread Eric V. Smith
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

<    21   22   23   24   25   26   27   >