[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi


Change by yota moteuchi :


--
components: +Interpreter Core -Library (Lib)

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



[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi


Change by yota moteuchi :


--
components: +Library (Lib)

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



[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi


New submission from yota moteuchi :

This improvement proposal is close to : https://bugs.python.org/issue42956 and 
also detailed in 
https://stackoverflow.com/questions/13855288/turn-slice-into-range

to iterate over a slice, the recommended method seems to be : 

s = slice(5,100,3)
for i in range(s.stop)[s] :
# do something

but if range() accepted directly a slice, it would dramatically improve the 
readability :

s = slice(5,100,3)
for i in range(s) :
# do something

and it could be convenient, especially inside the __getitem__ property. I'll 
try to make a quick patch to test...

--
messages: 410143
nosy: yota moteuchi
priority: normal
severity: normal
status: open
title: range() function could accept slice() objects as parameters
type: enhancement
versions: Python 3.11

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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2021-01-19 Thread yota moteuchi


yota moteuchi  added the comment:

one option to could be to create a hardlink_to() method which is 
link.hardlink_to(target) and in a few release, deprecate link_to ? :)

--
nosy: +yota moteuchi

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



[issue41875] __builtin_unreachable error in gcc 4.4.5

2020-09-28 Thread yota moteuchi

New submission from yota moteuchi :

While compiling a very recent release of Python (ie. 3.9.0rc2) with a fairly 
old release of gcc (ie. debian 6.0.6 gcc 4.4.5) I get the following error :

gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden  -I./Include/internal  -I. -I./Include-DPy_BUILD_CORE 
-o Parser/pegen/pegen.o Parser/pegen/pegen.c

Parser/pegen/pegen.c: In function ‘_PyPegen_seq_count_dots’:
Parser/pegen/pegen.c:1414: error: implicit declaration of function 
‘__builtin_unreachable’

Indeed, this '__builtin_unreachable()' function will exists starting from gcc 
4.5.

The configure file could detect this and offer an alternative.

(does a table of the supported gcc release for each python versions exists ?)

--
components: Build
messages: 377594
nosy: yota moteuchi
priority: normal
severity: normal
status: open
title: __builtin_unreachable error in gcc 4.4.5
type: compile error
versions: Python 3.9

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



[issue24663] ast.literal_eval does not handle empty set literals

2016-02-27 Thread yota moteuchi

yota moteuchi added the comment:

Well, I would disagree with R. David Murray on this.

literal_eval() is meant to safely parse literal pythons "containers" structures.

{1, 2, 3} is a valid literal set(), why would an empty one not be parse-able as 
well. I can not predict, when I dump the structure with repr(), if the set() 
will be empty or not.

--
nosy: +yota moteuchi

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