[Python-Dev] IOCP (I/O Completion Port) in Python ?

2013-09-10 Thread
Hello:
I wondering why there is no standard IOCP module in Python ?
As I know: Python3 have support epoll in linux and kqueue in freebsd.
Is there a plan to add IOCP module for Windows ?

Regards!
peipei
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread
Hello:
As far as I know, there is not a language support user defined operator 
overloading.
Python3 can overloading belowed operators.
-   negated
+   unchanged

-   minus
+   add
*   multiplication
/   division
//  true division
%   remainder
**  power
(Do I miss something ?)

If we can overloading these operators, why we can't overloading other operators?
(like .* often used in matrix, U in set operation)


Regards!
Peipei
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread
Hello:
I agree with Steven D'Aprano.
Here is an example:

class A(object):
def __init__(self, value):
self.value = value
def add(self, other):
return self.value + other.value
__magic_method__ = {'+':add}

a1 = A(1)
a2 = A(2)

We only need a macro expand
a1 + a2
to
a1.__magic__method__['+'](a, b)

the later can be execute on Python.

Regards
peipei
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread
On 2013/9/30 8:53 Greg Ewing wrote:
> It does need to know the operator's precedence and
>associativity, though, which means either declaring
>it somewhere, or having some kind of fixed rule

I suggest all user defined operator are at lowest priority.

Regards
peipei
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com