[issue39078] __function.__defaults__ breaks for __init__ of dataclasses with default factory

2019-12-17 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39078> ___ ___ Python-bugs-list mai

[issue39077] Numeric formatting inconsistent between int, float and Decimal

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

[issue39078] __function.__defaults__ breaks for __init__ of dataclasses with default factory

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: The problem is that __init__ has to have a sentinel to know whether or not to call the default value. If the default were just "dict", should it call it, or is the passed in value really dict, in which case it doesn't get called? datacla

[issue39078] __function.__defaults__ breaks for __init__ of dataclasses with default factory

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: I guess I could make the default value something like _CALLABLE(dict), but I'm not sure that would do you any good. But at least you could tell from the repr what it is. -- ___ Python tracker &

[issue39079] help() modifies the string module

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: With 2.7.16 on cygwin, I get: >>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> help(int) >>> string.letters 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you mean by the "pre-width 0". Is that the "0" here: format_spec ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type] ? And now that I write out the question, I'm sure that's what you

[issue39079] help() modifies the string module

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: @Zectbumo: is this causing you any practical problem? Or is it just a curiosity? -- ___ Python tracker <https://bugs.python.org/issue39

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that a quick glance in the rear view mirror shows that the design isn't awesome. But I just don't see how we can change it at this point. It is what it is. And it's no surprise that int and float have the same behavior: they share th

[issue39083] Dictionary get(key, default-expression) not short circuit behavior

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: .get() is just a regular function call. And like all python functions, all of the arguments are evaluated before the function is called. There is no mechanism in python to delay the evaluation of a arguments. You might want to look at collections.defaultdict

[issue39084] string.letters is flipped after setlocale is called

2019-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: This is a duplicate of issue 39079. I recommend that we don't "fix" this. It is only an issue with 2.7, and hasn't been a problem for years. -- nosy: +eric.smith ___ Python tracker <

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-18 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with your approach, Mark. And Michael: thanks for your report on the C behavior. I just wish we'd thought to look at this 13 years ago when .format() was being discussed. -- ___ Python tracker &

[issue39096] Description of "Format Specification Mini-Language" not accurate for Decimal

2019-12-19 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith, mark.dickinson ___ Python tracker <https://bugs.python.org/issue39096> ___ ___ Python-bugs-list mailing list Unsub

[issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation

2019-12-25 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset e28aff54d95236ea1b64b648d89a1516e446e621 by Eric V. Smith (Fabio Sangiovanni) in branch 'master': bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) (GH-17677) https://github.com/python/cpyt

[issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation

2019-12-25 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, all! -- ___ Python tracker <https://bugs.python.org/issue33961> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2019-12-26 Thread Eric V. Smith
Eric V. Smith added the comment: Is dataclasses doing something here that a regular, hand-written class wouldn't do? -- ___ Python tracker <https://bugs.python.org/is

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Pablo's analysis. And this can't be backported, since it's a new feature. So I'm closing this issue. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Does this occur often enough that it's worth the added code? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/is

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Then I'd suggest removing the optimization for "abcde"[2], too. I've never seen this in real code, and I can't come up with a scenario where it would be performance critical. Remember, one of the goals for CPython is to be reasonabl

[issue39225] Python should warn when a global/local has the same name as a builtin

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: On the other hand, this would generate a lot of warnings for users of libraries, who aren't able to do anything about it. I've got tons of existing code that uses the names of builtins as locals, to no harm. And as builtins are added, new warnings

[issue39240] keyerror in string format

2020-01-06 Thread Eric V. Smith
Eric V. Smith added the comment: When creating a bug report, please show the actual errors that you get. This is not a bug in python. In line 5 you're looking for composer2['third'], so of course you'd need to define it. -- components: -Regular Expressio

[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the PRs. -- nosy: +eric.smith resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38209] Simplify dataclasses.InitVar by using __class_getitem__()

2020-01-07 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue39247> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Eric V. Smith
Eric V. Smith added the comment: Your code basically becomes similar to this: sentinel = object() class FileObject: _uploaded_by: str = None uploaded_by = None def __init__(self, uploaded_by=sentinel): if uploaded_by is sentinel: self.uploaded_by

[issue39284] Flexible indentation

2020-01-10 Thread Eric V. Smith
Eric V. Smith added the comment: Please discuss this idea on the python-ideas mailing list first. It would also certainly require a PEP. But I don't want to get your hopes up: there's almost no chance that this would be accepted. I'm going to close this issue. If the

[issue39247] dataclass defaults and property don't work together

2020-01-10 Thread Eric V. Smith
Eric V. Smith added the comment: > During this processing of fields, couldn't you just special case > property/descriptor objects? What if you want the field to be a descriptor? I think the best way of handling this would be to use some sentinel value for the default, and if fo

[issue39300] dataclasses non-default argument follows default argument

2020-01-11 Thread Eric V. Smith
Eric V. Smith added the comment: > Ah, I see, so if I understand correctly the init method for the example given > would become __init__(self, PARAM: int = 1, ARG: int) since the fields are > kept in an ordered mapping Correct. -- assignee: -> eric.smith resolution:

[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Eric V. Smith
Eric V. Smith added the comment: Maybe argparse could raise an exception derived from SystemExit, then you could catch that. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39

[issue39354] collections.UserString format and format_map return a string

2020-01-16 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39354> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39416] Document default numeric string formats

2020-01-21 Thread Eric V. Smith
Eric V. Smith added the comment: Is the lack of this documentation causing some confusion somewhere? This isn't rhetorical, I'm genuinely curious what problem you're trying to solve. Is there any mainstream programming language where the basics of what you've laid out

[issue39380] ftplib uses latin-1 as default encoding

2020-01-23 Thread Eric V. Smith
New submission from Eric V. Smith : What's the reason behind this change? I love UTF-8 and all, but is there some standard (de facto or de jure) that discusses this? What does this change fix? What's the implication to existing clients? I'm not opposed to the change per se,

[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2020-01-24 Thread Eric V. Smith
Eric V. Smith added the comment: Isn't that the entire point of "from __future__ import annotations"? Also, please show the traceback when reporting errors so that I can see what's going on. -- ___ Python tracker <

[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2020-01-24 Thread Eric V. Smith
Eric V. Smith added the comment: Well the type comes from the annotation, so this makes sense to me. If dataclasses were to call get_type_hints() for every field, it would defeat the purpose of PEP 563 (at least for dataclasses). -- ___ Python

[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2020-01-24 Thread Eric V. Smith
Eric V. Smith added the comment: > Should `dataclass.Field.type` become a property that evaluates the annotation > at runtime much in the same way that `get_type_hints` works? I think not. But maybe a function that evaluates all of the field types. Or maybe an @dataclass parameter to

[issue14715] test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state

2020-01-28 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think so. I don't think the patch even did what I wanted it to do. I'll close it. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue39524] Escape sequences in doc string of ast._pad_whitespace

2020-02-02 Thread Eric V. Smith
Eric V. Smith added the comment: I think this would be an improvement, and an good issue for a newcomer. I'd vote for the r-string, but it doesn't really matter. -- keywords: +easy, newcomer friendly nosy: +eric.smith stage: ->

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: There are a number of bugs about this. See issue 35212 and issue 34364, at least. I have a stale patch that tried to fix this, but I was never able to get it completely correct. I have another approach that I hope to discuss at the language summit at PyCon

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, my approach is to use the tokenizer to produce the parts of the f-string, instead of treating it as a normal string and making a second pass to parse out the pieces. I've been discussing this for a few years, and at last PyCon I talked to many

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: I'll see if I can dig up the patch today. If I can find it, I'll attach it to issue 34364. This is really the first time I've tried to write down all of the issues related to tokenizing f-strings. It does seem a little daunting, but I'm n

[issue39568] FORMATTING grouping_option ValueError: Cannot specify ', ' with ...

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: No one thought it made sense to have a comma every 3 bits. Or for octal or hex, either. Do you have some specific use case where it makes sense? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.

[issue39568] FORMATTING grouping_option ValueError: Cannot specify ', ' with ...

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: Well, you asked why commas only work with decimals and I told you. Adding "_" would require a PEP. See PEP 378 if you want to write something similar for "_". I think it's a decent idea. You'll have to decide between 4 and 8 b

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: Can I ask how pegen solved this problem? Did you move parsing of f-strings into the grammar? I found my patch and I'm working on resolving merge conflicts. -- ___ Python tracker <https://bugs.py

[issue39574] str.__doc__ is misleading

2020-02-07 Thread Eric V. Smith
Eric V. Smith added the comment: That's a good improvement, Steven. I like your wording about errors better than the wording about encoding, so how about changing the next to last sentence to: "If errors is specified, encoding defaults to sys.getdefaultencoding()."

[issue39574] str.__doc__ is misleading

2020-02-07 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +1 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18401 ___ Python tracker <https://bugs.python.org/issu

[issue39574] str.__doc__ is misleading

2020-02-07 Thread Eric V. Smith
Eric V. Smith added the comment: I've created a PR and requested review from stevendaprano. I think the backports are correct. -- ___ Python tracker <https://bugs.python.org/is

[issue39574] str.__doc__ is misleading

2020-02-07 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that the current changes are an improvement, and should be committed. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39596] reverse parameter for enumerate()

2020-02-10 Thread Eric V. Smith
Eric V. Smith added the comment: You can already do this using existing composable tools, including: >>> list((item, idx) for idx, item in enumerate(lis)) [('a', 0), ('b', 1), ('c', 2), ('d', 3)] >>> We won't be adding a paramete

[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-10 Thread Eric V. Smith
Eric V. Smith added the comment: I always use datetime for testing such things. Its __format__() returns its argument, as long as you don't have '%' in it. I do agree that it's odd that the doubled braces cause the expression to be evaluated, but are still kept as

[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread Eric V. Smith
Eric V. Smith added the comment: But you can't just change it without breaking the code of anyone who's relying on the current behavior. If we could say "no one relies on that", that's would let us move forward with such a breaking change. But I don't think w

[issue39601] brace escapes are not working in formatted string literal format specifications

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

[issue39615] cpython/abstract.h not compatible with C90

2020-02-12 Thread Eric V. Smith
Eric V. Smith added the comment: PEP 7 says that this is allowed: Python versions greater than or equal to 3.6 use C89 with several select C99 features: ... - intermingled declarations So I don't think these changes should be accepted. -- nosy: +eric.

[issue39615] cpython/abstract.h not compatible with C90

2020-02-12 Thread Eric V. Smith
Eric V. Smith added the comment: I'd suggest mentioning this on python-dev, if you want to change the policy. -- ___ Python tracker <https://bugs.python.org/is

[issue39662] Characters are garbled when displaying Byte data

2020-02-17 Thread Eric V. Smith
Eric V. Smith added the comment: How do you know that isn't what is coming in over the serial port? I don't see any indication that this is a bug in python. We can't really help you here with this sort of problem. I suggest you take this to the python-list maili

[issue39662] Characters are garbled when displaying Byte data

2020-02-17 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue39662> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: I don't see why it would. You're raising OSError, which is not a subclass of TimeoutError, so the TimeoutError code is not executing. You don't say, but I assume this is what you think should happen. The exception handling machinery does no

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: In both examples, what's being printed? It's not clear from your messages. -- ___ Python tracker <https://bugs.python.o

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: Ah, I see. What platform are you on, and what's the value of errno.ETIMEDOUT? On cygwin I get: >>> errno.ETIMEDOUT 116 On a native Windows build I get: >>> errno.ETIMEDOUT 10060 and on Fedora I get: >>> errno.ETIMEDOUT

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: > These are both timeout errors but only `ETIMEDOUT` is accounted for? Yes, only ETIMEDOUT is accounted for in Objects/exceptions.c. There's precedent for mapping multiple errnos to the same exception: ADD_ERRNO(BlockingIOError, EAGAIN); A

[issue39673] Map errno==ETIME to TimeoutError

2020-02-18 Thread Eric V. Smith
Change by Eric V. Smith : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue39673> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39673] Map errno==ETIME to TimeoutError

2020-02-18 Thread Eric V. Smith
Change by Eric V. Smith : -- title: TimeoutError -> Map errno==ETIME to TimeoutError type: behavior -> enhancement ___ Python tracker <https://bugs.python.org/i

[issue39662] Characters are garbled when displaying Byte data

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: I'm going to close this. But if you have additional information that points to this being a bug in python, we can re-open it. -- resolution: -> not a bug stage: -> resolved status: pending -> closed

[issue39694] Incorrect dictionary unpacking when calling str.format

2020-02-20 Thread Eric V. Smith
Eric V. Smith added the comment: Is this causing some practical problem? I can't think of any way to reference non-string kwargs in a format string, but maybe I'm not being creative enough. And if there is such a way, then changing this wouldn't be back

[issue39694] Incorrect dictionary unpacking when calling str.format

2020-02-20 Thread Eric V. Smith
Eric V. Smith added the comment: Okay, then I agree with Serhiy on the change. And I agree that .format(**locals()) is an anti-pattern, and should use .format_map(locals()) instead. Not that it's related directly to this issue, I just like to point it out where

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Eric V. Smith
Eric V. Smith added the comment: The code is converting to a set first, then calls sorted() on that set. So "apple" is removed when the set is created. I'm not sure the example should throw in creating a set while it's talking about sorting.

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Eric V. Smith
Eric V. Smith added the comment: That sounds like a good improvement, Raymond. -- ___ Python tracker <https://bugs.python.org/issue39705> ___ ___ Python-bug

[issue39748] PyScripter could not find Python 3.8 64 bits

2020-02-25 Thread Eric V. Smith
Eric V. Smith added the comment: This sounds like an issue with PyScripter. I suggest you ask them for guidance on how to debug it. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39

[issue39748] PyScripter could not find Python 3.8 64 bits

2020-02-26 Thread Eric V. Smith
Eric V. Smith added the comment: I'm going to close this. If you have more information that shows it's a bug in Python, we can re-open it. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Pyt

[issue39760] ast.FormattedValue.format_spec unnecessarily wrapped in JoinedStr

2020-02-26 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that could probably be simplified, if the format_spec is constant (which it need not be). >>> ast.dump(ast.parse('f"is {x:d}"')) "Module(body=[Expr(value=JoinedStr(values=[Str(s='is '), FormattedValue(v

[issue39760] ast.FormattedValue.format_spec unnecessarily wrapped in JoinedStr

2020-02-26 Thread Eric V. Smith
Eric V. Smith added the comment: > FYI you can use ast CLI: I did not know that. That's awesome, thanks for pointing it out. -- ___ Python tracker <https://bugs.python.org

[issue39788] Exponential notation should return an int if it can

2020-02-28 Thread Eric V. Smith
Eric V. Smith added the comment: I strongly disagree. Even if I thought it was a good idea (I don't), we'd break too much code by making this change now. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.o

[issue39813] test_ioctl skipped -- Unable to open /dev/tty

2020-03-01 Thread Eric V. Smith
Eric V. Smith added the comment: Can you give us some information about your operating system? Did you build this version of python yourself? Assuming so, how did you build it? Please show us the header you see when starting this version of python. How are you invoking this test

[issue39818] Declaring local variable invalidates access to a global variable

2020-03-01 Thread Eric V. Smith
Eric V. Smith added the comment: This is by design. See https://eli.thegreenplace.net/2011/05/15/understanding-unboundlocalerror-in-python for a good explanation. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -&g

[issue39820] Bracketed paste mode for REPL

2020-03-03 Thread Eric V. Smith
Eric V. Smith added the comment: I suggest closing this issue. If the REPL is going to be improved, it won't be done one-feature-at-a-time on the bug tracker. It will need to have a holistic design that takes into account desired features and the architecture of the systems that it nee

[issue39841] "as" variable in except block deletes local variables with same name

2020-03-03 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, this is a known issue. See https://docs.python.org/3/reference/compound_stmts.html#the-try-statement, in particular the sentence "When an exception has been assigned using as target, it is cleared at the end of the except clause" and the foll

[issue39840] FileNotFoundError et al show b-prefix on filepaths if passed as bytes

2020-03-03 Thread Eric V. Smith
Eric V. Smith added the comment: That behavior is consistent with other exceptions. It's a helpful piece of information if you were to see it in a traceback, without any other context. So this is by design. -- nosy: +eric.smith resolution: -> not a bug stage: -> reso

[issue39820] Bracketed paste mode for REPL

2020-03-03 Thread Eric V. Smith
Eric V. Smith added the comment: Reasonable people can disagree. If someone else thinks this can be done piecemeal, then I'm not stopping anyone. I just think that's a mistake and will lead to much frustration. -- ___ Python track

[issue39842] partial_format()

2020-03-04 Thread Eric V. Smith
Eric V. Smith added the comment: Do you have some concrete use case for this, or is this a speculative feature request? This will do what you want, although it uses some undocumented internals of the _string module. I've only tested it a little, and I've done especially little t

[issue39842] partial_format()

2020-03-04 Thread Eric V. Smith
Eric V. Smith added the comment: I suggest using the version I posted here and see if it meets your needs. It uses the str.format parser to break the string into pieces, so it should be accurate as far as that goes. -- ___ Python tracker <ht

[issue39842] partial_format()

2020-03-04 Thread Eric V. Smith
Eric V. Smith added the comment: Well, I'm the one who made them private, I can make them public if they're useful. But I won't do that if you're not willing to look at it. -- ___ Python tracker <https://bug

[issue39888] modules not install

2020-03-07 Thread Eric V. Smith
Eric V. Smith added the comment: This looks like a network problem on your end, not a python bug. The bug tracker is not the place to get help for such an issue. You might try the python-list mailing list, although your best bet is to find someone locally who can help you debug your network

[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Eric V. Smith
Eric V. Smith added the comment: I believe this is by design, as is the same restriction on statement-level assignment expressions. And if requiring parens discourages the use of assignment expressions in asserts, I think that's a good thing. Why not just use the workaround you'

[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Eric V. Smith
Eric V. Smith added the comment: I'm going to close this, since I can't imagine this restriction being relaxed. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs

[issue39920] Pathlib path methods do not work with Window Dos devices

2020-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: I know it's of limited use, but for me, this code works (returns True) on Cygwin versions 3.8.0b4 and 3.7.4. On a native Windows build 3.8.0a0, I get the exception the OP shows. I'll try and install comparable versions when I'm at a locat

[issue39925] `pathlib.Path.link_to()` has the wrong argument order

2020-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: I think it's too late to change this. Is this a documentation issue? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/is

[issue39928] Pysftp Issue File Upload is not working - put command

2020-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: This is the python bug tracker. What you are reporting is almost certainly not a bug in python. If you think it is a bug in python, please reproduce it in the smallest possible code fragment, and with no third party libraries installed. If you're se

[issue39928] Pysftp Issue File Upload is not working - put command

2020-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: Hi, Sandeep. For information see https://mail.python.org/mailman/listinfo/python-list -- ___ Python tracker <https://bugs.python.org/issue39

[issue39925] `pathlib.Path.link_to()` has the wrong argument order

2020-03-11 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed it's a duplicate, so I'm closing this. For any further discussion, please use issue39291, or better yet, do as it suggests and discuss this on python-dev. -- resolution: -> duplicate stage: patch review -> resolved status

[issue39929] dataclasses.asdict will mangle collection.Counter instances

2020-03-11 Thread Eric V. Smith
Eric V. Smith added the comment: The asdict API was a mistake, because it's not possible for it to know how to create all possible sub-objects. I can't decide what to do about it. I might just "abandon it in place", by documenting its problems and suggesting it not

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39940] Micro-optimizations to PySequence_Tuple()

2020-03-11 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue39940> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39949] truncating match in regular expression match objects repr

2020-03-12 Thread Eric V. Smith
Eric V. Smith added the comment: I think the missing closing quote is supposed to be your visual clue that it's truncated. Although I'll grant you that it's pretty subtle. -- nosy: +eric.smith versions: +Python 3.9 ___ Python

[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Eric V. Smith
Eric V. Smith added the comment: tell() is opaque when opening a text file: you can't interpret the output, its only use is for input to seek(). >From the docs >https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects: "f.tell() returns an integer giving t

[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-14 Thread Eric V. Smith
Eric V. Smith added the comment: > That can big problem when I use serialization if f.tell() is "cookie". I'm sorry, but that's the way it is with text files. You'll need to find some other way to accomplish what you're trying to achieve. Since this isn

[issue39971] Error on documentation - Quick fix.

2020-03-15 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think that was meant to be a literal example. I think that "..." here means "and other strings". -- nosy: +eric.smith ___ Python tracker <https:

[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Eric V. Smith
Eric V. Smith added the comment: For what it's worth (which might not be much), here is what black produces: Module( body=[ Expr( value=Call( func=Name(id="spam", ctx=Load()), args=[Name(id="eggs", ctx=Loa

[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: Note that 2.7 is no longer supported. If you think you found a bug in 3.7, then please: - Reformat your code so that we can understand it. - Show us what output you actually get. - Show us what output you expect, and why. -- nosy: +eric.smith

[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: Can you see if the patch in issue27307 solves your problem? -- ___ Python tracker <https://bugs.python.org/issue39985> ___ ___

[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: In fact, this is a duplicate of issue27307, so I'm going to close this. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> string.Formatter does not support key/attribute access on

[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +tekknolagi ___ Python tracker <https://bugs.python.org/issue27307> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27307] string.Formatter does not support key/attribute access on unnumbered fields

2020-03-19 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue27

<    4   5   6   7   8   9   10   11   12   13   >