[OT] New to Python: Features

Richard Blackwood richardblackwood at cloudthunder.com
Tue Oct 5 11:04:29 EDT 2004


<SNIP>

>  
>
>>1. Multi line comments
>>    
>>
>No. There are no comments in Python.
>
>  
>
Well I known there are one-line comment (with a #)

> <SNIP>
>
>  
>
>>4. Operator overloading (inc. the ability to define new 
>>operators)
>>    
>>
>You can't define more than 5 new operators. After this it was decided
>you'd really be going too far with this whole O-O thing, leading to a
>quite different meaning for "overloading" in Python. Python programmers
>like to be different ;)
>  
>
Really?  That's silly. 

> <SNIP>
>
>6. Constructors
>In Python these are called "Buildy Things".
>
>  
>
Deconstructors too maybe?

>7. "Chunks": as in a code block 
>  
>
>>contained within a string, file, or 
>>delimited by some sort of notation (such as brackets) which can be 
>>passed to and from functions, stored in objects, with the option of 
>>local scoping of variables declared within it.
>>    
>>
>Code is actually contained in special "envelopes" fed into
>Python-engineered devices built into the back of most computers these
>days. Hand-crafted code in Python is literally just that.
>
>  
>
So your saying it has to be a module first for me to do this?

> <SNIP>
>
>>11. Can I make dynamic statements and nature like with eval() 
>>in Javascript?
>>    
>>
>There's a lot of nature in Python. Most programmers prefer a pastoral
>setting although some are hardy sea-faring folk. You should therefore
>intersperse any documentation with thoughts about your garden, when to
>harvest your crops, when the tide is likely to come in this evening,
>etc. Also many Python programmers consider "eval" to be evil because of
>that one letter difference. It's all in the semiotics.
>
>  
>
Did I really write nature by accident or did you modify that?!  :-P

>15. Proper Tail Call (otherwise known as Proper 
>  
>
>>Tail Recursion)
>>    
>>
>That's two 15's. Is this a form of duplicit recursion ?
>  
>
It's where if inside of a function you call another function and there 
are no other statements after that function call then the interpreter 
will erase the function from memory since there is no need to return to 
it.  I hope that's clear and that your not pulling my leg. 

>16. The ability to call a function without 
>  
>
>>brackets
>>    
>>
>You're kidding, right. Right ? Without brackets ? That's... that's just
>not possible is it ?
>
>  
>
In certain languages it is.  I think Lua lets you do it but more 
certainly I know Ruby does.

>17. Is the Python interpreter a JIT? Does it have a 
>  
>
>>bytecode?  Is it as 
>>fast as Java?
>>    
>>
>Python is generally 2000 to 3000 times faster than Java if you run Java
>on a toaster and Python on a super-cooled space computer orbiting
>Saturn.
>
>
>  
>
I guess that means no.  I have to install that JIT module someone 
refered me to.

> <SNiP>
>
>Sorry, my compilation has finished. Hope that helps...
>  
>
Thank you soooo much Mark.  I thoroughly enjoyed your replies and thank 
you for taking the time.



More information about the Python-list mailing list