Re: [Tutor] Python property()

2015-05-16 Thread Cameron Simpson
As Alan and I disagree on this, to a degree, I thought I would follow up to add another perspective. Remember that it is _only_ perspective; Alan's opinions are sound and have good reasons. So are mine:-) We place different values on the costs and benefits here. On 17May2015 00:27, alan.ga...@

Re: [Tutor] Python property()

2015-05-16 Thread Alan Gauld
On 16/05/15 20:25, daaku gee wrote: I think I understand what's going on here. What I don't understand is if/when to use property instead of a normal attribute. 1. Is 'property' used widely? Do you use it? No, Yes, occasionally I first came across properties in Borland Delphi (Object Pascal

[Tutor] Python property()

2015-05-16 Thread daaku gee
I came across some code where 'property' is being used for class attributes (or as a decorator @property) name = property(lambda self: getattr(self, '_data')['name']) I think I understand what's going on here. What I don't understand is if/when to use property instead of a normal attribute.

Re: [Tutor] Terminology question

2015-05-16 Thread Steven D'Aprano
On Sat, May 16, 2015 at 09:56:33AM -0700, Jim Mooney Py3.4.3winXP wrote: > def make_error(): > raise ZeroDivisionError('Here I am') > > def call_error(): > try: > make_error() > except: > print("How do I get the 'Here I am' message to print in the calling > routine?")

Re: [Tutor] Terminology question

2015-05-16 Thread Alan Gauld
On 16/05/15 17:56, Jim Mooney Py3.4.3winXP wrote: I can see I was marvelously unclear ;') Here is what I meant. def make_error(): raise ZeroDivisionError('Here I am') def call_error(): try: make_error() except: print("How do I get the 'Here I am' message to pri

Re: [Tutor] Terminology question

2015-05-16 Thread Jim Mooney Py3.4.3winXP
On 15 May 2015 at 22:45, Steven D'Aprano wrote: > > What does "didn't work" mean? Did your computer crash? Catch fire? A > completely different error got printed? Something else? I can see I was marvelously unclear ;') Here is what I meant. def make_error(): raise ZeroDivisionError('Here I

Re: [Tutor] How to print fixed length ascii?

2015-05-16 Thread Steven D'Aprano
On Sat, May 16, 2015 at 04:11:45AM +, Fast Primes wrote: > > How do I set Python to print fixed length ascii--whereby all characters have > the exact same length? Use a fixed-width font, also known as a non-proportional, monospaced or typewriter typeface. E.g. Monaco (Apple Mac), Courier (

Re: [Tutor] How to print fixed length ascii?

2015-05-16 Thread Alan Gauld
On 16/05/15 05:11, Fast Primes wrote: How do I set Python to print fixed length ascii--whereby all characters have the exact same length? It's not clear what you mean. Do you mean you want to use the ASCII character set? That limits all characters to 7 bits long. If so we probably need a l

[Tutor] How to print fixed length ascii?

2015-05-16 Thread Fast Primes
How do I set Python to print fixed length ascii--whereby all characters have the exact same length? Thanks. Alex ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/t