[issue35673] Loader for namespace packages

2019-01-08 Thread Eric V. Smith
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

[issue35710] Make dataclasses.field() accept another name for __init__ field's name

2019-01-10 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith type: -> enhancement ___ Python tracker <https://bugs.python.org/issue35710> ___ __

[issue35750] process finished with exit code -1073740940 (0xc0000374)

2019-01-16 Thread Eric V. Smith
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

[issue35761] Allow dataclasses to be updated in place

2019-01-17 Thread Eric V. Smith
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

[issue35761] Allow dataclasses to be updated in place

2019-01-17 Thread Eric V. Smith
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

[issue17005] Add a topological sort algorithm

2019-01-18 Thread Eric V. Smith
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

[issue35787] shlex.split inserts extra item on backslash space space

2019-01-20 Thread Eric V. Smith
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'

[issue35820] Inconsistent behavior when parsing IP address

2019-01-24 Thread Eric V. Smith
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

[issue35834] get_type_hints exposes an instance of ForwardRef (internal class) in its result, with `from __future__ import annotations` enabled

2019-01-26 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith, lukasz.langa ___ Python tracker <https://bugs.python.org/issue35834> ___ ___ Python-bugs-list mailing list Unsub

[issue35960] dataclasses.field does not preserve empty metadata object

2019-02-11 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue35960> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue35960] dataclasses.field does not preserve empty metadata object

2019-02-12 Thread Eric V. Smith
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

[issue35960] dataclasses.field does not preserve empty metadata object

2019-02-12 Thread Eric V. Smith
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

[issue35960] dataclasses.field does not preserve empty metadata object

2019-02-12 Thread Eric V. Smith
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

[issue36070] Enclosing scope not visible from within list comprehension

2019-02-21 Thread Eric V. Smith
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

[issue36077] Inheritance dataclasses fields and default init statement

2019-02-22 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue36077> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36077] Inheritance dataclasses fields and default init statement

2019-02-22 Thread Eric V. Smith
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

[issue29708] support reproducible Python builds

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

[issue29771] An email and MIME handling package - Add support to send CC of email

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

[issue29771] An email and MIME handling package - Add support to send CC of email

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

[issue29771] An email and MIME handling package - Add support to send CC of email

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

[issue29777] argparse arguments in main parser hide an argument in subparser

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

[issue29777] argparse arguments in main parser hide an argument in subparser

2017-03-10 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: rejected -> stage: resolved -> needs patch ___ Python tracker <http://bugs.python.org/issue29777> ___ ___ Pyth

[issue28739] PEP 498: docstrings as f-strings

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

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-14 Thread Eric V. Smith
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:

[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-03-15 Thread Eric V. Smith
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

[issue29837] python3 pycopg2 import issue on solaris 10

2017-03-17 Thread Eric V. Smith
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

[issue29863] Add a COMPACT constant to the json module

2017-03-20 Thread Eric V. Smith
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

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-23 Thread Eric V. Smith
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

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Eric V. Smith
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

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Eric V. Smith
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

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Eric V. Smith
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

[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Eric V. Smith
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.

[issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?"

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

[issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?"

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

[issue30031] Improve queens demo (use argparse and singular form)

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

[issue30031] Improve queens demo (use argparse and singular form)

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

[issue30090] Failed to build these modules: _ctypes

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

[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

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

[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Eric V. Smith
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

[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Eric V. Smith
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

[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-24 Thread Eric V. Smith
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

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-01 Thread Eric V. Smith
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

[issue28974] Make default __format__ be equivalent to __str__

2017-05-13 Thread Eric V. Smith
Eric V. Smith added the comment: I'm okay with this change. -- ___ Python tracker <http://bugs.python.org/issue28974> ___ ___ Python-bugs-list mailing list

[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-05-13 Thread Eric V. Smith
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

[issue30426] why not use the same style func name. eg: int.to_bytes (with underline) and array.tobytes(without underline).

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

[issue30426] why not use the same style func name. eg: int.to_bytes (with underline) and array.tobytes(without underline).

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

[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <http://bugs.python.org/issue30590> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Eric V. Smith
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

[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-08 Thread Eric V. Smith
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> ___ ___

[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Eric V. Smith
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")'

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Eric V. Smith
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

[issue34776] Postponed annotations break inspection of dataclasses

2019-03-05 Thread Eric V. Smith
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

[issue33944] Deprecate and remove pth files

2019-03-07 Thread Eric V. Smith
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

[issue36400] Add activate script to venv root folder

2019-03-22 Thread Eric V. Smith
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

[issue11644] Cross-link 2to3 documentation, what’s new and pyporting howto

2019-03-23 Thread Eric V. Smith
Eric V. Smith added the comment: I agree we should close this. -- ___ Python tracker <https://bugs.python.org/issue11644> ___ ___ Python-bugs-list mailin

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-03-23 Thread Eric V. Smith
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> ___ ___

[issue36424] Pickle fails on frozen dataclass that has slots

2019-03-25 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue36424> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36480] .strip() unexpected output on Windows

2019-03-29 Thread Eric V. Smith
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 <

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-03-30 Thread Eric V. Smith
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

[issue36480] .strip() unexpected output on Windows

2019-03-30 Thread Eric V. Smith
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

[issue36480] .strip() unexpected output on Windows

2019-03-30 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36480> ___ ___

[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
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: >

[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36524> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36580] unittest.mock does not understand dataclasses

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

[issue36592] is behave different for integers in 3.6 and 3.7

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

[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module

2019-04-12 Thread Eric V. Smith
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

[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module

2019-04-12 Thread Eric V. Smith
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

[issue36622] Inconsistent exponent notation formatting

2019-04-12 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith, mark.dickinson, skrah ___ Python tracker <https://bugs.python.org/issue36622> ___ ___ Python-bugs-list mailin

[issue35271] venv creates pyvenv.cfg with wrong home

2019-04-17 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.or

[issue36655] Division Precision Problem

2019-04-18 Thread Eric V. Smith
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

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Eric V. Smith
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

[issue36662] asdict/astuple Dataclass methods

2019-04-19 Thread Eric V. Smith
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

[issue36617] The rich comparison operators are second class citizens

2019-04-19 Thread Eric V. Smith
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

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-20 Thread Eric V. Smith
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

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-20 Thread Eric V. Smith
Eric V. Smith added the comment: I definitely think any missing import from typing should be added. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36697] inspect.getclosurevars returns wrong globals dict

2019-04-23 Thread Eric V. Smith
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 ->

[issue36697] inspect.getclosurevars returns wrong globals dict

2019-04-23 Thread Eric V. Smith
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())

[issue36705] Unexpected Behaviour of pprint.pprint

2019-04-23 Thread Eric V. Smith
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

[issue36723] Unittest Discovery for namespace subpackages dot notation fails

2019-04-25 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36723> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2019-04-26 Thread Eric V. Smith
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

[issue36727] python 3.6+ docs use ul tags instead of ol tags

2019-04-26 Thread Eric V. Smith
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

[issue36727] python 3.6+ docs use ul tags instead of ol tags

2019-04-26 Thread Eric V. Smith
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

[issue36727] python 3.6+ docs use ul tags instead of ol tags

2019-04-26 Thread Eric V. Smith
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

[issue36740] zipimporter misses namespace packages for implicit dirs

2019-04-28 Thread Eric V. Smith
Eric V. Smith added the comment: This is a duplicate of issue 14905. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36740> ___ ___ Pytho

[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Eric V. Smith
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

[issue36765] Invalid grammar for f_expression

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

[issue36772] Let lru_cache be used as a decorator with no arguments

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

[issue36774] f-strings: Add a !d conversion for ease of debugging

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

[issue36774] f-strings: Add a !d conversion for ease of debugging

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

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +12976 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36774] f-strings: Add a !d conversion for ease of debugging

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

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Eric V. Smith
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

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Eric V. Smith
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

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Eric V. Smith
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

[issue36774] f-strings: Add a !d conversion for ease of debugging

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

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-04 Thread Eric V. Smith
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}') ...

[issue36798] := breaks f-strings

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

[issue36798] := breaks f-strings

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

[issue36798] := breaks f-strings

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

[issue36798] := breaks f-strings

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

<    11   12   13   14   15   16   17   18   19   20   >