[issue47247] Default arguments for access 'mode' parameters in pathlib and os should display as octal literals

2022-04-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is a duplicate of #46782.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47247>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would dataclasses do that's different from a regular class?

--

___
Python tracker 
<https://bugs.python.org/issue47237>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: Inheritance from Protocol with property in class makes them 
non-instantiatable -> Inheritance from base class with property in class makes 
them non-instantiatable

___
Python tracker 
<https://bugs.python.org/issue47237>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from Protocol with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Here's the error without dataclasses:

--
from typing import Protocol

class SomeProtocol(Protocol):
@property
def some_value(self) -> str: ...

class SomeClass(SomeProtocol):
def __init__(self, some_value):
self.some_value = some_value

if __name__ == '__main__':
a = SomeClass(some_value="value")
--

Traceback (most recent call last):
  File "foo.py", line 12, in 
a = SomeClass(some_value="value")
^
  File "foo.py", line 9, in __init__
self.some_value = some_value
^^^
AttributeError: property 'some_value' of 'SomeClass' object has no setter


And here it is without Protocol:

class SomeProperty:
@property
def some_value(self) -> str: ...

class SomeClass(SomeProperty):
def __init__(self, some_value):
self.some_value = some_value

if __name__ == '__main__':
a = SomeClass(some_value="value")


Traceback (most recent call last):
  File "foo.py", line 10, in 
a = SomeClass(some_value="value")
^
  File "foo.py", line 7, in __init__
self.some_value = some_value
^^^
AttributeError: property 'some_value' of 'SomeClass' object has no setter

--
title: Inheritance from Protocol with property in dataclass makes them 
non-instantiatable -> Inheritance from Protocol with property in class makes 
them non-instantiatable

___
Python tracker 
<https://bugs.python.org/issue47237>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47203] ImportError: DLL load failed while importing binascii: %1 is not a valid Win32 application.

2022-04-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 
<https://bugs.python.org/issue47203>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47202] Feature request: Throw an error when making impossible evaluation against an empty list

2022-04-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

As Jelle says, this can't be a runtime Exception.

At best mypy or a linter could make iterating over an known empty list (like a 
literal []) a warning, not an error as suggested by the OP. I sometimes 
"comment out" loops by doing something like:

for i in []: # long_list_returning_function():
# lots of code here

I do this just to avoid re-indenting everything if I want to skip the loop 
during development.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-04-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this. If you have a more concrete proposal, either re-open 
this or bring it up on python-ideas.

--
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-31 Thread Eric V. Smith


Eric V. Smith  added the comment:

Same question as Alex: what does the TypeAlias being inside the class offer 
that being at module level doesn't?

--

___
Python tracker 
<https://bugs.python.org/issue47166>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

My personal usage of a topological sort are restricted to maybe 100 entries 
max, so I can't really test this in any meaningful way.

That, and the project that uses it is stuck on 3.6, so I haven't switched to 
the graphlib version yet.

--

___
Python tracker 
<https://bugs.python.org/issue47145>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

There's also this StackOverflow question about it: 
https://stackoverflow.com/questions/38344244/tuples-operator-throws-exception-but-succeeds

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 
<https://bugs.python.org/issue47155>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is an FAQ: 
https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47155>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I blame the lack of standard POSIX functions for doing DNS lookups 
> asynchronously and in a way that provides TTL information to the client.

I totally agree with that!

And I agree it would be nice to have some way of doing non-blocking lookups 
when the TTL expires (or whenever it decides it needs to do a lookup). But it's 
going to be non-trivial, I fear.

--

___
Python tracker 
<https://bugs.python.org/issue47149>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

Hmm. I'm not sure we should try to work around a bad resolver issue. What's 
your platform, and how did you install Python?

--

___
Python tracker 
<https://bugs.python.org/issue47149>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Do you mean expiring the IP address when the TTL is reached? 

Yes, that's what I mean. Isn't the resolver library smart enough to cache 
lookups and handle the TTL timeout by itself?

--

___
Python tracker 
<https://bugs.python.org/issue47149>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith

Eric V. Smith  added the comment:

If you don’t look it up every time, how do you deal with DNS timeouts?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47149>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39971] [doc] Error in functional how-to example

2022-03-29 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +rhettinger

___
Python tracker 
<https://bugs.python.org/issue39971>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31140] Insufficient error message with incorrect formated string literal

2022-03-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, they should update Python. A lot of work went in to fixing these issues, 
and won't be backported.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue31140>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47137] MemoryError in codeop.compile_command

2022-03-28 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47129] Improve errors messages in f-string syntax errors

2022-03-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, @macgors!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 
<https://bugs.python.org/issue47129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47129] Improve errors messages in f-string syntax errors

2022-03-28 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset 7b44ade018cfe6f54002a3cee43e8aa415d4d635 by Maciej Górski in 
branch 'main':
bpo-47129: Add more informative messages to f-string syntax errors (32127)
https://github.com/python/cpython/commit/7b44ade018cfe6f54002a3cee43e8aa415d4d635


--

___
Python tracker 
<https://bugs.python.org/issue47129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47137] MemoryError in codeop.compile_command

2022-03-28 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +pablogsal
title: MemoryError -> MemoryError in codeop.compile_command
versions: +Python 3.8

___
Python tracker 
<https://bugs.python.org/issue47137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47137] MemoryError

2022-03-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

A simpler reproducer is:
codeop.compile_command('[' * 100)

Verified I get MemoryError on cygwin PYthon 3.8.12. A length of 99 does not 
show a problem.

On Windows 3.11.0a5+, I get:

>>> codeop.compile_command('[' * 201)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 107, in 
compile_command
return _maybe_compile(_compile, source, filename, symbol)
   ^^
  File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 70, in 
_maybe_compile
compiler(source + "\n", filename, symbol)
^
  File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 86, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT | 
PyCF_ALLOW_INCOMPLETE_INPUT)
   
^^^
  File "", line 1


[

^
SyntaxError: too many nested parentheses

A length of 200 seems to work correctly.

So it looks like this was fixed somewhere along the line, I'm guessing with the 
PEG parser. I suspect backporting the fix to older versions won't be possible.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36643] Forward reference is not resolved by dataclasses.fields()

2022-03-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Jelle here: dataclasses shouldn't be calling get_type_hints().

--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue36643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-27 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

>From a suggestion by @Jelle on the python discord server: how about just 
>"f-string: expression required before '!'"?

--

___
Python tracker 
<https://bugs.python.org/issue47129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not convinced this is an improvement. I don't think someone trying '!' in 
an f-string expression happens often enough to worry about that specific error 
message.

And a generic "optional specifier" isn't great. If we're going to do this, it 
should reflect the actual thing that's present: a conversion specifier, a 
format specifier, or debug specifier. And "optional" doesn't add anything, 
since it's actually present in this string.

I'll give it some more thought. I can't come up with an error message I 
actually like. The focus still needs to be on the empty expression.

--
assignee:  -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue47129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47073] Solution for recursion error when comparing dataclass objects

2022-03-20 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue47073>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for all of your work, @ariebovenberg!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-19 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 82e9b0bb0ac44d4942b9e01b2cdd2ca85c17e563 by Arie Bovenberg in 
branch 'main':
bpo-46382 dataclass(slots=True) now takes inherited slots into account 
(GH-31980)
https://github.com/python/cpython/commit/82e9b0bb0ac44d4942b9e01b2cdd2ca85c17e563


--

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8

2022-03-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Since those releases are no longer supported, I don't think there's any place 
you could put this that would be seen. And we wouldn't want to put a note in a 
current release about a bug in a non-supported version that was fixed in 
another non-supported version.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47055>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

I thought there was an existing issue that covered this, but now I can't find 
it.

I'd prefer #2, create a separate issue.

--

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree the error message could be better. Also, "s.error('bad escape %s' % 
this, len(this))" should probably be "from None", since as @mrabarnett notes 
the KeyError is an implementation detail.

--

___
Python tracker 
<https://bugs.python.org/issue47023>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't have a problem saying that for a class to be used as a base class for a 
dataclass, its __slots__ must not be an iterator that's been exhausted. That 
doesn't seem like a very onerous requirement.

I'm also not concerned about people using __slots__ to iterate over the fields, 
but I agree that a documentation note couldn't hurt.

@ariebovenberg: go ahead and submit your PR. Thanks!

--

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, I assume that's what the OP intended, but then stumbled across the error 
with '\s'.

In any event, I don't think there's a bug here so I'm going to close this. 
@siddheshsathe: if you disagree, please respond here.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 
<https://bugs.python.org/issue47023>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Is there any reason to keep this issue open? The PR was merged.

--

___
Python tracker 
<https://bugs.python.org/issue46553>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue47023>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Serhiy: Could you point to some documentation on __slotnames__? I see a few 
references in the code to it, but it's not set on simple test class.

>>> class A:
... __slots__=('a',)
...
>>> A.__slotnames__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: type object 'A' has no attribute '__slotnames__'. Did you mean: 
'__slots__'?
>>>

--

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47034] pickle not working correctly when custom field is directly initialized by constructors

2022-03-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

You're probably doing something like:

parent.i = 3

instead of:

parent.child.field = 0.6

In the first one, you're setting an instance attribute on parent, on the 
second, you're modifying an attribute of the class attribute.

In any event, there's no bug here, so I'm going to close this. If you have 
followup questions, I suggest you use the python-list mailing list or 
https://discuss.python.org/c/users

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47034>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47034] pickle not working correctly when custom field is directly initialized by constructors

2022-03-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

child is not an attribute of a Parent instance, but rather of the Parent class. 
So it's not going to be saved when you dump "parent", which is an instance of 
Parent.

I'm not sure what you're doing when you create a Parent.__init__ method, but 
presumably setting self.child, which will then create an instance attribute 
which will get saved by pickle.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47034>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2022-03-16 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Incorrect exception highlighting for fstring format

___
Python tracker 
<https://bugs.python.org/issue35212>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46404] 3.11a4: a small attrs regression

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

@frenzy: I'm not sure what your fix would do. You could either describe it in 
rough terms (if you'd like a pre-PR opinion on the approach), or I'm happy to 
wait to see your PR.

--

___
Python tracker 
<https://bugs.python.org/issue46404>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Isn't '\s' covered by: " Unknown escapes of ASCII letters are reserved for 
future use and treated as errors" 
(https://docs.python.org/3/library/re.html#re.sub)?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47023>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

In case it helps anyone:

On Windows 3.11.0a5+ the full traceback is:

$ ./python.bat demo.py
Running Debug|x64 interpreter...
Traceback (most recent call last):
  File "...\demo.py", line 23, in 
sys.exit(main())
 ^^
  File "...\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "...\demo.py", line 11, in _tmp_path
yield pathlib.Path(tmp_dir)
^^^
  File "...\demo.py", line 18, in main
import module
^
  File "", line 1178, in _find_and_load
  File "", line 1140, in _find_and_load_unlocked
  File "", line 1080, in _find_spec
  File "", line 1487, in find_spec
  File "", line 1459, in _get_spec
  File "", line 1596, in find_spec
  File "", line 1656, in _fill_cache
TypeError: a bytes-like object is required, not 'str'

And on cygwin 3.8.12:

$ python demo.py
Traceback (most recent call last):
  File "", line 1346, in 
_path_importer_cache
KeyError: b'/tmp/tmprpymgive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 23, in 
sys.exit(main())
  File "demo.py", line 18, in main
import module
  File "", line 991, in _find_and_load
  File "", line 971, in _find_and_load_unlocked
  File "", line 914, in _find_spec
  File "", line 1407, in find_spec
  File "", line 1376, in _get_spec
  File "", line 1348, in 
_path_importer_cache
  File "", line 1324, in _path_hooks
  File "", line 1594, in 
path_hook_for_FileFinder
  File "", line 1469, in __init__
  File "", line 177, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue47025>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation).

2022-03-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Jelle gives the correct reason for what you're seeing.

Also note:

>>> math.nan == math.nan
False
>>> float('nan') == float('nan')
False

If there's some specific part of the documentation that you think is 
misleading, please reopen this and point us to the wording that's confusing.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47020>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47002] argparse - "expected one argument" when used -: in argument

2022-03-13 Thread Eric V. Smith


Eric V. Smith  added the comment:

Here's a simplified reproducer:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--utc", choices=["-1:00"])
args = parser.parse_args()

I assume this is related to argparse guessing if an argument is a negative 
number. See 
https://stackoverflow.com/questions/9025204/python-argparse-issue-with-optional-arguments-which-are-negative-numbers

>From a suggestion there, note that
python test.py -u ' -1:00'
doesn't give the "expected one argument" error. I realize that doesn't solve 
your problem, but it does shed some light on the issue.

I suspect this can't be fixed without breaking other usages of argparse.

--
components: +Library (Lib) -Parser
nosy: +eric.smith, paul.j3 -lys.nikolaou, pablogsal

___
Python tracker 
<https://bugs.python.org/issue47002>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith

Eric V. Smith  added the comment:

I’m sorry, I don’t understand your proposal. Please answer my question about 
what “x” would be equal to under your proposed change.

--

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would x be equal to here:

def get_something_string():
 return textwrap.dedent("""\
 test text2
 test text3
 test text4""")

x = f"""\
 test text1
 {get_something_string()}
 test text5
 test text6"""

?

With 3.10 it is: ' test text1\n test text2\ntest text3\ntest text4\n
 test text5\n test text6'

Are you proposing to change that?

--

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would the presence of "<<" do? You haven't described your proposal.

--

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

What is the flag you mention? What would it do?

This sounds like a new feature, which can only go in to 3.11.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree it's not worth fixing in 3.9 and 3.10.

--

___
Python tracker 
<https://bugs.python.org/issue44799>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46974] set function for lists on numbers, sometimes sorts elements from smallest to largest, and sometimes not

2022-03-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is expected behavior. A set has no defined order. If you convert a set to 
a list, and you want some specific order, you'll need to sort it yourself.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46974>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I would argue that "The reference documentation for X states that it gets 
> raised under condition Y" generally should be understood as "this is a 
> guarantee that also includes the guarantee that it is not raised under other 
> conditions in correctly written code".

That's definitely not the case in Python, though.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 
<https://bugs.python.org/issue46972>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

The documentation doesn't say that assert statements are the only place 
AssertionError is raised, so I don't think it's incorrect.

> From this, one can infer the guarantee "the -O flag will suppress 
> AssertionError exceptions from being raised".

I don't think that follows from what the documentation says. It's only talking 
about assert statements.

This is equivalent to StopIteration: it is commonly raised by exhausting 
iterators, but it can be raised elsewhere. Or KeyError: the docs say "Raised 
when a mapping (dictionary) key is not found in the set of existing keys", but 
I've raised them in my own code.

> An assert[{add reference to `assert` definition}] statement fails, or a unit 
> testing related assert{...}() callable detects an assertion violation.

I think that's also misleading, and not an improvement. Why focus just on 
testing? It can certainly be raised elsewhere.

If anything, I think maybe add a note at the top of the list of Concrete 
Exceptions saying these are common ways these exceptions are raised, but they 
can be raised elsewhere. But I'm -0 on such a change.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46972>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

This appears to be due to dataclasses needing to create a new class in order to 
set __slots__. I'll look at it, but I doubt there's anything that can be done.

attrs has the same issue:
  File "x/.local/lib/python3.8/site-packages/attr/_make.py", line 889, in 
_create_slots_class
cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd)
TypeError: __init_subclass__() missing 1 required positional argument: 'msg'

--
assignee:  -> eric.smith
type: crash -> behavior

___
Python tracker 
<https://bugs.python.org/issue46970>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46957] Logger with a custom class breaks on copy

2022-03-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

In what way does it break? You haven't shown an error.

Why are you deepcopying the logger?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46957>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46945] Quantifier and Expanded Regex Expression Gives Different Results

2022-03-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Regular Expressions -Library (Lib)
nosy: +ezio.melotti, mrabarnett

___
Python tracker 
<https://bugs.python.org/issue46945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

If you go with the second idea, I'd say something like f"More than {2 * 
tracebacklimit} additional stack frames not shown". It seems handy to know the 
magnitude of the problem.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46949>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46941] Bug or plug not removed (The operator "is")

2022-03-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

As others have noted, the behavior is intentional, so I'm closing this.

--
nosy: +Dennis Sweeney, Jelle Zijlstra, eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46941>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46938] dataclass __post_init__ recursion

2022-03-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yeah, I've come to the conclusion that it's not so simple, either. I'm also 
thinking that advising to call the base __init__ is a mistake.

--

___
Python tracker 
<https://bugs.python.org/issue46938>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46938] dataclass __post_init__ recursion

2022-03-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is a bug in the code. I'll have a PR ready shortly.

But since it's a non-trivial change, I'm going to target it for 3.11 only.

--
assignee: docs@python -> eric.smith
versions:  -Python 3.10, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46938>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46461] Kodi crashing

2022-03-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

I don’t have Ubuntu to test on. Plus the steps to reproduce are too much for 
the average volunteer to work through. I don’t think we’ll be able to help.

--

___
Python tracker 
<https://bugs.python.org/issue46461>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

I understand. Then I'm going to close this issue, since there's nothing we can 
do.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46061>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I was running one python script

Again: you need to show us the script that's causing this problem. I (and 
millions of others) run scripts all the time which do not fail in the way you 
describe. Unless you show us a script that causes the problem, we cannot help 
you.

--

___
Python tracker 
<https://bugs.python.org/issue46061>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46904] Python Decimal supports '#' format, C Decimal does not.

2022-03-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +mark.dickinson

___
Python tracker 
<https://bugs.python.org/issue46904>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46904] Python Decimal supports '#' format, C Decimal does not.

2022-03-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46904>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

>From https://github.com/python/cpython/blob/main/Python/marshal.c:

41 is:

#define TYPE_SMALL_TUPLE')'

The difference between 41 and 169 is 128:

#define FLAG_REF'\x80' /* with a type, add obj to index */

So the difference is the FLAG_REF bit being set. I'm not sure if that helps you 
or not.

In any event, this doesn't look like a bug. You might want to ask on 
python-list or Stack Overflow for more help.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46900>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46856] datetime.max conversion

2022-02-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

Probably so. You could step through the code to make sure that's what's going 
on.

--

___
Python tracker 
<https://bugs.python.org/issue46856>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46856] datetime.max conversion

2022-02-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please show us how they fail.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46856>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-22 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 288af845a32fd2a92e3b49738faf8f2de6a7bf7c by Eric V. Smith in 
branch 'main':
bpo-46757: Add a test to verify dataclass's __post_init__ isn't being 
automatically added. (GH-31523)
https://github.com/python/cpython/commit/288af845a32fd2a92e3b49738faf8f2de6a7bf7c


--

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm adding a test that mimic's Raymond's example of the proposed addition being 
a breaking change. This way, if we ever decide to actually add this feature, 
we'll break this test. If we do decide to continue and make the change anyway, 
at least we'll do so with the knowledge that it's a breaking change.

--

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
pull_requests: +29650
pull_request: https://github.com/python/cpython/pull/31523

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this issue. As Raymond says, it's a breaking change, and the 
workaround is easy enough.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-20 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

The fact that it's never been needed in the years that dataclasses and attrs 
have existed tell me it's kind of a niche requirement.

This does not seem like the ugliest code I've ever seen:

if hasattr(super(), "__post_init__"):
super().__post_init__()

or the probably more efficient, but more lines of code:

try:
post_init = super().__post_init__
except AttributeError:
pass
else:
post_init()

As always with calling super functions, the whole hierarchy needs to cooperate. 
Say you had a dataclass:

@dataclass
class Base:
def __post_init__(self, some_arg):
pass

How would an arbitrary derived class know how to call this? It can't. There has 
to be knowledge of the base class's requirements already. Surely knowing 
"__post_init__ must be called with some_arg" isn't too different from "I know 
__post_init__ doesn't exist". I don't think adding ways to make the "always 
call super" pattern easier is a good idea.

I'm still unconvinced, but I'll hold off on making a decision to see if there's 
more support. Maybe taking it to python-ideas would be worthwhile.

--

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not crazy about adding a method to every dataclass just for the 0.1% of the 
times it's needed.

I think using hasattr or catching the exception is a better way to go.

--

___
Python tracker 
<https://bugs.python.org/issue46757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46792] Indentation not preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: Indentation now preserved with ruamel.yaml.round_trip_dump -> 
Indentation not preserved with ruamel.yaml.round_trip_dump

___
Python tracker 
<https://bugs.python.org/issue46792>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46792] Indentation now preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

This looks like an issue with ruamel.yaml, which is a third party package. You 
should report it to them.

Good luck!

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46792>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45559] pprint tests do not test pprint.pprint()

2022-02-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Sure, have a go at it!

Any testing of pprint.pprint() would be an improvement, but ideally all options 
should be tested.

It would probably be worthwhile to restructure the tests to run both pformat 
and pprint tests from the same logic, so that we only need to change one thing 
if new options are added. I haven't looked at the tests, so I'm not sure how 
much work this would be.

--

___
Python tracker 
<https://bugs.python.org/issue45559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-16 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset ffd9f8ff84ed53c956b16d027f7d2926ea631051 by Eric V. Smith in 
branch 'main':
bpo-46762: Fix an assert failure in f-strings where > or < is the last 
character if the f-string is missing a trailing right brace. (#31365)
https://github.com/python/cpython/commit/ffd9f8ff84ed53c956b16d027f7d2926ea631051


--

___
Python tracker 
<https://bugs.python.org/issue46762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-15 Thread Eric V. Smith


Change by Eric V. Smith :


--
keywords: +patch
pull_requests: +29515
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31365

___
Python tracker 
<https://bugs.python.org/issue46762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Good catch! I'll have a patch tonight.

--

___
Python tracker 
<https://bugs.python.org/issue46762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46751] Windows-style path is not recognized under cygwin

2022-02-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

>:) Citing myself:

>> Trying this *bash* command line:

Oops, sorry for missing that.

As for 3.9: it's not available through the 64 bit installer (at least, I don't 
see it there). I'll look and see what's involved in installing it.

Are you running the 32- or 64-bit version?

Also: I suspect this is a cygwin problem that will need to be reported upstream.

--

___
Python tracker 
<https://bugs.python.org/issue46751>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46751] Windows-style path is not recognized under cygwin

2022-02-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Are you running from bash (or another cygwin shell), or from cmd.exe, or 
something else?

How did you install the version of python you're executing in the examples you 
provided? To my knowledge, cygwin's installer doesn't have a 3.9 available.

I don't see this behavior on cygwin's python3.8, either from cmd.exe or from 
zsh.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46751>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46735] gettext.translations crashes when locale is unset

2022-02-13 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Library (Lib) -Parser
type: crash -> behavior

___
Python tracker 
<https://bugs.python.org/issue46735>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46739] dataclasses __eq__ isn't logical

2022-02-13 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue46739>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46739] dataclasses __eq__ isn't logical

2022-02-13 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Mark. It's identical to:

>>> () == ()
True

As for the non-dataclass version, that's a normal object identity comparison if 
no __eq__ is defined: 
https://docs.python.org/3/reference/datamodel.html#object.__eq__ , third 
paragraph.

--

___
Python tracker 
<https://bugs.python.org/issue46739>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46701] cannot use typographical quotation marks in bug description

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please report bug tracker bugs at https://github.com/python/bugs.python.org

Although to be honest I doubt this will be fixed, since we're moving to Github 
issues.

--
nosy: +eric.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46701>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll close it.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46693>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Henry Schreiner!

--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43532>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I believe dataclasses uses repr() of the members, not str(). Can you try using 
specifying __repr__ in Teacup? Just __repr__ = __str__ should work.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46693>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue46693>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Good catch, @xtreak. I think something like the discussed (but not implemented) 
custom matching protocol would be required here. __match_args__ won't work, 
because it's a special attribute only checked on classes, not instances.

Of course, I'm still not sure this is what the original poster is requesting!

But assuming so, this would require a PEP, and should be discussed with the PEP 
634 authors.

--

___
Python tracker 
<https://bugs.python.org/issue46692>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Looking at PEP 634, the obvious way to add support for this is to have the 
re.Match object specify Py_TPFLAGS_MAPPING. But I tried that, and then I get 
this error when using an re.Match object in a match statement:

case {'one': x, 'two': y}:
 
TypeError: object of type 're.Match' has no len()


Add len() to re.Match objects was rejected when __getitem__ was added to 
re.Match, in issue 24454.

I haven't explored other ways to support re.Match objects in the match 
statement.

--

___
Python tracker 
<https://bugs.python.org/issue46692>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Oops, slight bug in my code. Use this:

import re

def f(map):
print(f'input={map["one"]} {map["two"]}')
match map:
case {'one': x, 'two': y}:
print(f"match {x} {y}")
case _:
print("no match")

d = {'one':0, 'two':1}
f(d)
m = re.match("(?Pa)b(?Pc)", "abc")
f(m)

With this output:
input=0 1
match 0 1
input=a c
no match

--

___
Python tracker 
<https://bugs.python.org/issue46692>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Interpreter Core

___
Python tracker 
<https://bugs.python.org/issue46692>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


New submission from Eric V. Smith :

You need to provide more information.

Is your concern that re.match objects aren't matched like dicts are, despite 
looking like a mapping?

import re

def f(map):
print(f'input={m["one"]} {m["two"]}')
match map:
case {'one': x, 'two': y}:
print(f"match {x} {y}")
case _:
print("no match")

m = re.match("(?Pa)b(?Pc)", "abc")
d = {'one':0, 'two':1}
f(d)
f(m)

produces:
input=a c
match 0 1
input=a c
no match

I assume you're not reporting a bug, so I'm going to mark this as a feature 
request.

--
nosy: +eric.smith
type: behavior -> enhancement
versions:  -Python 3.10

___
Python tracker 
<https://bugs.python.org/issue46692>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46683>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Where did you get the tarball?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46683>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Given this current behavior:

>>> def foo(a, /, b): pass
...
>>> foo()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo() missing 2 required positional arguments: 'a' and 'b'

What would you suggest?

I agree the current messages aren't perfect.

--

___
Python tracker 
<https://bugs.python.org/issue46637>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

I guess the technically correct term is positional-or-keyword, but that seems 
like too much: https://docs.python.org/3/glossary.html

I think dropping "positional" doesn't increase the precision of the error 
message, but I'll admit I can't think of anything better. And lacking something 
better I don't think we should change this.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46637>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >