[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


--
nosy: +Vadim Pushtaev
nosy_count: 7.0 -> 8.0
pull_requests: +27390
pull_request: https://github.com/python/cpython/pull/24244

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


--
nosy: +Vadim Pushtaev

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Hello.

This is my solution for this problem - 
https://github.com/python/cpython/pull/8452

Sorry if I'm not supposed to do anything about the already assigned issue, feel 
free to ignore my PR.

--

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Hello. I would like to work on this, should the issue be assigned on me or this 
comment is enough?

--
nosy: +Vadim Pushtaev

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

That's OK, you can do it.

--

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



[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-27 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

This indeed doesn't make much sense now. I'll try to send a PR today.

--
nosy: +Vadim Pushtaev

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



[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-27 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Okay then.

--

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

I'm trying to do something about this. Let me know if you have some ideas.

--
nosy: +Vadim Pushtaev

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Here is what I learned:

1) Nothing is wrong with that "tuple.__new__(sys.flags) is not safe" part. 
`__new__` is deleted from `type(sys.flags)`, so parent's `__new__` is called. 
`tuple` is indeed a base class for `type(sys.flags)`.

2) Another part where we recommend to use "sys.flags.__new__()" doesn't make 
much sense, so I choose to delete this advice if there is no `__new__` in a 
class.

3) This second part also may suggest a wrong class to call `__new__` from:


In [1]: from collections import namedtuple

In [2]: class A(namedtuple('A', 'z')):
   ...: pass
   ...:

In [3]: object.__new__(A)
---
TypeError Traceback (most recent call last)
 in ()
> 1 object.__new__(A)

TypeError: object.__new__(A) is not safe, use tuple.__new__()


This should be A.__new__(), not tuple.__new__().

--

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


--
keywords: +patch
pull_requests: +8083
stage:  -> patch review

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



[issue34284] Nonsensical exception message when calling `__new__` on some sys objects

2018-07-30 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

> 1. In this case, this will produce the error "tuple.__new__(sys.flags) is not 
> safe". But I didn't call "tuple.__new__", I called sys.flags.__new__, and 
> type(X).__new__(type(X)) should always be safe

Should it? There is no sys.flags.__new__, tuple.__new__ is called and it has 
different __new__.

> 2. The change in error message for namedtuples (A) isn't related and (B) 
> isn't correct. `tuple.__new__(NamedTuple)` works, and produces a namedtuple 
> object, so tuple.__new__ is what the error should point to.

I believe you are right about (A), it's not related and should be discussed 
separately.

--
title: Nonsensical exception message when calling `__new__` on non-instaniable 
object -> Nonsensical exception message when calling `__new__` on some sys 
objects

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-07-31 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

> See also issue31506

Okay, I admit, reporting `tuple.__new__` instead of `sys.flags` is misleading.

But what about this?

> `tuple.__new__(NamedTuple)` works, and produces a namedtuple object, so 
> tuple.__new__ is what the error should point to.

Isn't it the same? Why should we say anything about `tuple` if a user wants A? 
This looks similar to 31506:

>>> from collections import namedtuple
>>> class A(namedtuple('x', 'x')):
... pass
...
>>> A.__new__(1, 2)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in __new__
TypeError: tuple.__new__(X): X is not a type object (int)

--

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-08-06 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Sorry for the delay, I'm still working on a new PR.

--

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-08-08 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Usually, tp_new==NULL means that __new__ is inherited, but not always. Here is 
the comment from typeobject.c:

/* The condition below could use some explanation.
   It appears that tp_new is not inherited for static types
   whose base class is 'object'; this seems to be a precaution
   so that old extension types don't suddenly become
   callable (object.__new__ wouldn't insure the invariants
   that the extension type's own factory function ensures).
   Heap types, of course, are under our control, so they do
   inherit tp_new; static extension types that specify some
   other built-in type as the default also
   inherit object.__new__. */


So my current solution is to explicitly set __new__ to the common helper 
function that raises TypeError in that case.

---

Thanks a lot for your comments and ideas. In truth, I feel a little overwhelmed 
and definitely need further guidance for this issue.

--

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-09-03 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Also for `curses.panel.panel`:

>>> from curses.panel import panel
>>> panel.__new__(panel)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object.__new__(_curses_panel.panel) is not safe, use 
_curses_panel.panel.__new__()

--

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