[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

New submission from Wen Adam:

SelectSelector._select is differently on different platforms.

On win32, SelectSelector._select is a unbound/bound method and pass instance as 
the first argument, but on *nix, SelectSelector._select is a 
builtin_function_or_method(Although self.select still works)

If someone want to replace(or patch) select, he must implement two select 
function(one is a function, the other is a instance method), 
Otherwise you will get「TypeError: select() takes at most 4 arguments (5 given)」.

And I think make built-in funtion(like len, select.select) as a class 
attr/method is a black magic(it's still a function) and hard to maintain

--
components: Library (Lib)
files: uniform_select_behaviour.patch
keywords: patch
messages: 285891
nosy: Wen Adam, neologix
priority: normal
severity: normal
status: open
title: Uniform SelectSelector._select behavior
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46352/uniform_select_behaviour.patch

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

Wen Adam added the comment:

Thx for your replying, Peksag.

I encountered this problem is really because of Gevent and Selector34. Gevent 
fixed this issue but only works for 
python3.4+(https://github.com/gevent/gevent/blob/master/src/gevent/monkey.py#L497)
 by a tricking way. python 2.x still has this problem

--

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

Wen Adam added the comment:

I know it works on python3.4, but black magic still exists in selectors lib,and 
3rd-party module have to prepare two function to make compatibility.

--

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