On Thu, Jan 22, 2015 at 10:12 PM, Mario Figueiredo wrote:
> I agree. TypeVar will help tremendously by removing the need for union in
> cases of object inheritance. But only on cases of object inheritance.
Why only inheritance? One of the examples is of str and bytes, which
don't have any inherit
Chris,
On Thu, Jan 22, 2015 at 9:46 PM, Nicholas Cole
wrote:
Hang on! The particular example may not make a lot of sense but there
are plenty of places in ordinary Python where functions can accept
different objects in arguments and return different things. The point
here is that that will be
Chris,
I'd rather see a real-world example that can't be solved with either
better design or some simple aliases. (And yes, the type hinting does
allow for aliases.)
Python is a duck-typing language, Chris. It is in its nature -- and we have
been taught -- to ignore types and care only about
On Thu, Jan 22, 2015 at 9:37 PM, Mario Figueiredo wrote:
> Chris,
>
>> Hold on a moment, how often do you really do this kind of thing with
>> "might be one of them or a sequence"?
>
>
> Is it really that important that I give a more real-life example, or can't
> you just get the problem from a ad
On Thu, Jan 22, 2015 at 9:46 PM, Nicholas Cole wrote:
> Hang on! The particular example may not make a lot of sense but there are
> plenty of places in ordinary Python where functions can accept different
> objects in arguments and return different things. The point here is that
> that will become
On Thursday, 22 January 2015, Chris Angelico > wrote:
> On Thu, Jan 22, 2015 at 7:10 PM, Mario Figueiredo
> wrote:
> > Possibly one common use case will be Unions. And that factory syntax is
> > really awful and long when you look at a function definition with as
> > little as 3 arguments. The on
Chris,
Hold on a moment, how often do you really do this kind of thing with
"might be one of them or a sequence"?
Is it really that important that I give a more real-life example, or can't
you just get the problem from a ad-hoc example?
I could replace the variable names with spam, ham and
Rick,
Python is the only thing that is pure in the programming world. The
only language that offers the cleanest and most intuit-able syntax,
AND YOU"RE JUST GOING TO THROW IT ALL AWAY SO YOU CAN BE A LAPDOG OF
SATAN?
Nonsense. You are just used to it. I can read C with the same feeling of
in
On Thu, Jan 22, 2015 at 9:05 PM, Marko Rauhamaa wrote:
> Rick Johnson :
>
>> Python is the only thing that is pure in the programming world. The
>> only language that offers the cleanest and most intuit-able syntax,
>> AND YOU"RE JUST GOING TO THROW IT ALL AWAY SO YOU CAN BE A LAPDOG OF
>> SATAN?
On Thu, Jan 22, 2015 at 7:00 PM, ermanolillo wrote:
> s = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_ICMPV6)
>
> However I recive the next error:
>
>
>
> File "server.py", line 16, in
> s.bind((HOST, 0))
> File "/usr/lib/python2.7/socket.py", line 224, in meth
> return getattr
Rick Johnson :
> Python is the only thing that is pure in the programming world. The
> only language that offers the cleanest and most intuit-able syntax,
> AND YOU"RE JUST GOING TO THROW IT ALL AWAY SO YOU CAN BE A LAPDOG OF
> SATAN?
I think the SATAN is in the optional type declarations, not in
On Thu, Jan 22, 2015 at 7:10 PM, Mario Figueiredo wrote:
> Possibly one common use case will be Unions. And that factory syntax is
> really awful and long when you look at a function definition with as
> little as 3 arguments. The one below has only 2 arguments.
>
> def handle_employees(emp: Union
On Thu, Jan 22, 2015 at 8:10 AM, Mario Figueiredo wrote:
> In article <54c0a571$0$13002$c3e8da3$54964...@news.astraweb.com>,
> steve+comp.lang.pyt...@pearwood.info says...
>>
>> The point isn't that there are no other alternative interpretations
>> possible, or that annotations are the only syntax
On 22/01/2015 04:30, Steven D'Aprano wrote:
Occasionally you find people spreading Fear, Uncertainty, Doubt about
Python. Python is now over 20 years old and one of the most popular
languages in the world no matter how you measure popularity:
http://import-that.dreamwidth.org/1388.html
so you d
On 22/01/2015 03:38, Guohua Ouyang wrote:
This is my first post to the list, I apologies firstly if I made any mistake.
I was trying to get a package in golang behind the http or https
proxy, and it reports an error "AttributeError: httpsconnection
instance has no attribute '_set_hostport'", de
On Thursday, January 22, 2015 at 1:23:40 AM UTC-6, Steven D'Aprano wrote:
> The point isn't that there are no other alternative
> interpretations possible, or that annotations are the only
> syntax imaginable, but that they're not hard to guess what
> they mean, and if you can't guess, they're not
On 22/01/2015 08:24, Rick Johnson wrote:
Yes, YES, *YES* That would be my first choice, or
docstrings as a secondary. But to introduce new syntax
into the method signatures is SUICIDE! What the hell is
this man thinking?
I take it you mean these men Guido van Rossum ,
Jukka Lehtosalo , Łu
Hi all
I have xmlrpc server written in Java, and it has a method like
Fun( vector, vector), the vector is array of user-defined object, which is
a class extends HashMap.
And I call it like:
server = xmlrpclib.ServerProxy("http://myserver";)
server.Fun( [ {"0.5":0.1}], [ ] )
It always fails
On Thursday, January 22, 2015 at 12:48:46 AM UTC-6, Paul Rubin wrote:
> Sir Richard Johnson writes:
> You could write some IDE features to suppress visibility
> of the hints. Or maybe it could be done with a decorator-
> like construct:
>
> @-spec(Iterable[Real], Real) -> Real
Yes, YES, *YES*!!
This is my first post to the list, I apologies firstly if I made any mistake.
I was trying to get a package in golang behind the http or https
proxy, and it reports an error "AttributeError: httpsconnection
instance has no attribute '_set_hostport'", details in the bottom.
After some trace work,
In article <54c0a571$0$13002$c3e8da3$54964...@news.astraweb.com>,
steve+comp.lang.pyt...@pearwood.info says...
>
> The point isn't that there are no other alternative interpretations
> possible, or that annotations are the only syntax imaginable, but that
> they're not hard to guess what they m
I've made a snniferr for a ICMP socket that works with IPv4. This is the
code:
import sys
import socket
import struct
import select
import time
import signal
import re
HOST = raw_input("Enter the interface to listen: ")
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO
101 - 122 of 122 matches
Mail list logo