[issue36077] Inheritance dataclasses fields and default init statement

2019-08-02 Thread Daniel Lepage


Daniel Lepage  added the comment:

A simpler way to merge them would be to make all arguments after a default 
argument keyword-only, e.g.

__index__(self, i, j=0, *, k, l=0)

It does mean you'd have to explicitly write e.g. Child(1, k=4), but that's a 
lot more readable than seeing Child(1, 4) and wondering which field gets the 4.

--
nosy: +Daniel Lepage2

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

Daniel Lepage added the comment:

I tried it on python 2.7.12 and python 2.6.9 since I had them lying around and 
got the same behavior.

--

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

New submission from Daniel Lepage:

The following code causes a segmentation fault:
class Failure(object):
def __getattr__(self, attr):
return (self, None)
issubclass(Failure(), int)

I am running a macbook pro, OS X 10.12.4, and have observed the problem in 
python 3.5.2, 3.6.0, and 3.6.1.

It appears that returning (self,) causes it to go into an infinite loop 
attempting to get `x.__bases__`, and returning `(self, y)` for any value `y` 
causes it to attempt to get `x.__bases__` 262,030 times and then segfault.

A crash log is attached.

--
components: Interpreter Core
files: segfault.crash
messages: 295150
nosy: Daniel Lepage
priority: normal
severity: normal
status: open
title: issubclass segfaults on objects with weird __getattr__
type: crash
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46924/segfault.crash

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

Changes by Daniel Lepage <dplep...@gmail.com>:


--
versions: +Python 2.7

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



[issue25803] pathlib.Path('/').mkdir() raises wrong error type

2015-12-05 Thread Daniel Lepage

Daniel Lepage added the comment:

It looks like this is an OSX-specific behavior, and not a python problem:
 $ mkdir .
mkdir: .: File exists
 $ mkdir /
mkdir: /: Is a directory

--

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



[issue25803] pathlib.Path('/').mkdir() raises wrong error type

2015-12-04 Thread Daniel Lepage

New submission from Daniel Lepage:

pathlib.Path('/').mkdir() raises an IsADirectoryError instead of a 
FileExistsError.

--
components: Library (Lib)
messages: 255916
nosy: Daniel Lepage
priority: normal
severity: normal
status: open
title: pathlib.Path('/').mkdir() raises wrong error type
type: behavior
versions: Python 3.5

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