Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-09 Thread Bruno Desthuilliers
aspineux a écrit :
 Hi
 
 I read the PEP 3117 about the new Postfix type declarations  in
 Python3000.
 THIS PEP as been REJECTED ! 

Indeed - it's an april's fool joke !-)

And BTW, no need to scream, we hear you pretty well.

 But ...
 
 The notation in the PEP is very ugly !  This make python code more
 difficult to read!
 
 Anyway when I switched to python (from C, C++, ..), I suffered a lot
 of the
 untyped python variables.
 And I think this is a good idea to include
 typing in python.

The concept of type greatly differs between static typing and dynamic 
typing. FWIW, it also somewhat differs between declarative static type 
systems (C/C++/Java/etc) and inference-based static type systems (OCaml, 
Haskell etc).

Anyway, Python is dynamically typed (FWIW, it's dynamic almost 
everywhere), and this is probably not going to change in a foreseeable 
future. So I guess you'd better learn to use dynamic typing instead of 
trying to write C++ in Python - or, if you just can't get used to 
dynamic typing, use another language.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-05 Thread aspineux
On Jan 5, 4:39 am, aspineux [EMAIL PROTECTED] wrote:
 Hi

 I read the PEP 3117 about the new Postfix type declarations  in
 Python3000.
 THIS PEP as been REJECTED ! But ...

 The notation in the PEP is very ugly !  This make python code more
 difficult to read!

 Anyway when I switched to python (from C, C++, ..), I suffered a lot
 of the
 untyped python variables. And I think this is a good idea to include
 typing in python.

 Then I get this idea: The editor could hide the typing notation, just
 displaying hint !
 It could also auto-complete the type of any variable having already a
 type in
 the current function, and underline untyped variable or variable
 having multiple type inside the function.

 Just an idea !

And to go further the editor could do all the job of type checking,
using formatted comment to specify type, like in some existing
embedded documentation.


But then we are losing the brevity provided by the PEP.


Pydev (and certainly other) already does some interesting work to find
mistyped
(typed like in I made a typo) variable name.

TO ALL NEW IDEA RESISTANT :

Hopefully, in 1990 nobody said to someone that inventing a language
where bloc definition
is based on indentation was a s


Regards


 Alain Spineux

 Happy new year.

-- 
http://mail.python.org/mailman/listinfo/python-list


Language type systems (was: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable)

2008-01-05 Thread Ben Finney
John Nagle [EMAIL PROTECTED] writes:

(I'm writing as someone who's used and liked very strictly typed
 languages like Ada and Modula.

Python is strictly typed (also known as strongly typed
URL:http://en.wikipedia.org/wiki/Strongly-typed), because its
objects know exactly what type they are and won't contort themselves
into another type unless there's an explicitly defined method for
doing so.

I think you mean you're accustomed to statically-typed languages,
where names are restricted at compile-time in what values they can
refer to. This is as opposed to Python being a dynamically-typed
language: names are not restricted in the type of object they can be
bound to, and the type of a value is determined when that value is
created URL:http://en.wikipedia.org/wiki/Type_system#Type_checking.

 Python actually does unusually well without declarations. Most
 languages that don't have declarations run into difficulties.
 Consider Basic, TCL, and Matlab, to name three rather diverse
 examples. Python managed to avoid the problems those languages
 have.)

Those three diverse examples are all weakly typed languages. Since
Python is strongly-typed and dynamically-typed, this could largely
explain the difference you see in Python doing unusually well without
declarations compared to those languages.

-- 
 \It is the responsibility of intellectuals to tell the truth |
  `\and expose lies.  -- Noam Chomsky |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Language type systems (was: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable)

2008-01-05 Thread Russ P.
Since
 Python is strongly-typed and dynamically-typed, this
 --

Hyphenating after ly is grammatically incorrect.

  \It is the responsibility of intellectuals to tell the truth |
   `\and expose lies.  -- Noam Chomsky

Never quote Noam Chomsky on truth. He wouldn't know it if it bit
him.

Nice post otherwise. I'm just fooling around.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-05 Thread Kay Schluehr
On Jan 5, 7:07 am, John Nagle [EMAIL PROTECTED] wrote:

 Python doesn't really need explicit type declarations.
 They're not needed for correctness, and they're not needed for
 performance.  Take a look at Shed Skin, which is able to hard-compile Python
 using type inference without explicit type declarations.

ShedSkin is not Python.

-- 
http://mail.python.org/mailman/listinfo/python-list


How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-04 Thread aspineux
Hi

I read the PEP 3117 about the new Postfix type declarations  in
Python3000.
THIS PEP as been REJECTED ! But ...

The notation in the PEP is very ugly !  This make python code more
difficult to read!

Anyway when I switched to python (from C, C++, ..), I suffered a lot
of the
untyped python variables. And I think this is a good idea to include
typing in python.

Then I get this idea: The editor could hide the typing notation, just
displaying hint !
It could also auto-complete the type of any variable having already a
type in
the current function, and underline untyped variable or variable
having multiple type inside the function.

Just an idea !


Alain Spineux

Happy new year.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-04 Thread Steven D'Aprano
On Fri, 04 Jan 2008 19:39:13 -0800, aspineux wrote:

 Hi
 
 I read the PEP 3117 about the new Postfix type declarations  in
 Python3000.
 THIS PEP as been REJECTED ! But ...
 
 The notation in the PEP is very ugly !  This make python code more
 difficult to read!

Please look at the date on the PEP:

http://www.python.org/dev/peps/pep-3117/


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-04 Thread John Nagle
aspineux wrote:
 Hi
 
 I read the PEP 3117 about the new Postfix type declarations  in
 Python3000.
 THIS PEP as been REJECTED ! 

Of course.  That was a joke.

  And I think this is a good idea to include typing in python.

Python doesn't really need explicit type declarations.
They're not needed for correctness, and they're not needed for
performance.  Take a look at Shed Skin, which is able to hard-compile Python
using type inference without explicit type declarations.

(I'm writing as someone who's used and liked very strictly typed
languages like Ada and Modula.  Python actually does unusually well
without declarations.  Most languages that don't have declarations
run into difficulties.  Consider Basic, TCL, and Matlab, to name
three rather diverse examples.  Python managed to avoid the problems
those languages have.)

John Nagle
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-04 Thread Russ P.
On Jan 4, 10:07 pm, John Nagle [EMAIL PROTECTED] wrote:
 aspineux wrote:
  Hi

  I read the PEP 3117 about the new Postfix type declarations  in
  Python3000.
  THIS PEP as been REJECTED !

 Of course.  That was a joke.

   And I think this is a good idea to include typing in python.

 Python doesn't really need explicit type declarations.
 They're not needed for correctness, and they're not needed for
 performance.  Take a look at Shed Skin, which is able to hard-compile Python
 using type inference without explicit type declarations.

 (I'm writing as someone who's used and liked very strictly typed
 languages like Ada and Modula.  Python actually does unusually well
 without declarations.  Most languages that don't have declarations
 run into difficulties.  Consider Basic, TCL, and Matlab, to name
 three rather diverse examples.  Python managed to avoid the problems
 those languages have.)

 John Nagle

Interesting. And how did it do that?
-- 
http://mail.python.org/mailman/listinfo/python-list