Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Peter Otten
Rustom Mody wrote:

> Others have answered some parts
 if x in x_list:
> ... print("That is a fruit.")
> ... else:
> ... print("That is not a fruit.")
> ...
> 
> However one can distribute the print out of the if; Thus
> 
 "This is %s a fruit" % ("" if x in x_list else "not")

Which of the two versions will most readers grasp at first sight?
Which one is easier to modify so that it works for arbitrary attributes?
Which one is easier to internationalize?

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


Re: Simple exercise

2016-03-15 Thread Steven D'Aprano
On Tuesday 15 March 2016 16:26, Jussi Piitulainen wrote:

> Steven D'Aprano writes:
> 
>> Unfortunate or not, it seems to be quite common that "zip"
>> (convolution) discards items when sequences are of different lengths.
> 
> Citation needed. Where is zip called convolution?

Wikipedia :-)

Unfortunately "convolution" is one of those technical terms with many 
related but slightly different meanings. It's used in calculus, signal 
processing, geology, biology, probability theory, formal languages, and 
more. I don't have a citation for it being used in functional programming, 
but is it so hard to believe? A "convolution" is usually described as 
something being folded over another thing, which sounds rather like zip, 
doesn't it?

Take two pieces of paper, say one white and one black, one on top of the 
other, and fold them in half, then in half again, then again:

zero folds = W B

one fold = W B B W

two folds = W B B W W B B W


which is not that far from what zip would give you:

W B W B W B W B ...


I don't know enough about the lambda calculus and other theoretical computer 
science topics to give a definitive citation for "zip" being a convolution, 
but I do know enough to accept it as plausible.



> Why should zip be called convolution?

Why should anything be called anything?

Don't worry, I'm not suggesting that the zip function be renamed.


>> See https://en.wikipedia.org/wiki/Convolution_%28computer_science%29
> 
> "This article possibly contains original research. Please improve it by
> verifying the claims made and adding inline citations."

Meh, there are Wikipedia editors that seem to flag just about every article 
with that. You could write "water is wet" and technically that's "original 
research" that needs a citation. It is so over-used that it is practically 
meaningless.


-- 
Steve

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


Re: Simple exercise

2016-03-15 Thread Chris Angelico
On Tue, Mar 15, 2016 at 7:39 PM, Steven D'Aprano
 wrote:
>> Why should zip be called convolution?
>
> Why should anything be called anything?
>
> Don't worry, I'm not suggesting that the zip function be renamed.
>

It's like referring to the 'and' and 'or' operators as conjunctions
and disjunctions. You wouldn't rename the operators, but it's still
accurate to describe them that way.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple exercise

2016-03-15 Thread Jussi Piitulainen
Steven D'Aprano writes:

> On Tuesday 15 March 2016 16:26, Jussi Piitulainen wrote:
>
>> Steven D'Aprano writes:
>> 
>>> Unfortunate or not, it seems to be quite common that "zip"
>>> (convolution) discards items when sequences are of different lengths.
>> 
>> Citation needed. Where is zip called convolution?
>
> Wikipedia :-)
>
> Unfortunately "convolution" is one of those technical terms with many
> related but slightly different meanings. It's used in calculus, signal
> processing, geology, biology, probability theory, formal languages,
> and more. I don't have a citation for it being used in functional
> programming, but is it so hard to believe? A "convolution" is usually
> described as something being folded over another thing, which sounds
> rather like zip, doesn't it?

I'm asking precisely because the term "convolution" already has more
interesting uses that I find somewhat non-trivial, and I don't see zip
being one of those.

> Take two pieces of paper, say one white and one black, one on top of the 
> other, and fold them in half, then in half again, then again:
>
> zero folds = W B
>
> one fold = W B B W
>
> two folds = W B B W W B B W
>
>
> which is not that far from what zip would give you:
>
> W B W B W B W B ...

Seems different to me.

> I don't know enough about the lambda calculus and other theoretical computer 
> science topics to give a definitive citation for "zip" being a convolution, 
> but I do know enough to accept it as plausible.

Perhaps someone else can provide citations. At the moment, I think the
idea is both new and bad.

>> Why should zip be called convolution?
>
> Why should anything be called anything?
>
> Don't worry, I'm not suggesting that the zip function be renamed.

I'm not worried about "zip". I'm worried about "convolution". It's
confusing to adopt an existing term for a different purpose.

>>> See https://en.wikipedia.org/wiki/Convolution_%28computer_science%29
>> 
>> "This article possibly contains original research. Please improve it by
>> verifying the claims made and adding inline citations."
>
> Meh, there are Wikipedia editors that seem to flag just about every article 
> with that. You could write "water is wet" and technically that's "original 
> research" that needs a citation. It is so over-used that it is practically 
> meaningless.

In this case, it seems accurate to me. The article makes a factual claim
that the term is actually used this way in computer science, with no
evidence to back it up. I doubt it. I failed to find evidence myself.

Anyone?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread alister
On Mon, 14 Mar 2016 20:31:06 +, BartC wrote:

> On 14/03/2016 19:45, alister wrote:
>> On Mon, 14 Mar 2016 14:43:22 +, BartC wrote:
>>
>>> On 13/03/2016 09:39, Steven D'Aprano wrote:
 On Sun, 13 Mar 2016 04:54 am, BartC wrote:
>>>
> Common sense tells you it is unlikely.

 Perhaps your common sense is different from other people's common
 sense. To me, and many other Python programmers, it's common sense
 that being able to replace functions or methods on the fly is a
 useful feature worth having. More on this below.

 Perhaps this is an example of the "Blub Paradox":
>>>
>>> Perhaps it's time to talk about something which many languages have,
>>> but Python hasn't. Not as far as I know anyway.
>>>
>>> That's references to names (sometimes called pointers). So if I write:
>>>
>>>a = 100 f(a)
>>>
>>> then function f gets passed the value that a refers to, or 100 in this
>>> case. But how do you pass 'a' itself?
> 
>> Congratulations you have just proven that you have faild in your
>> understanimg of python @
>> stage 1 becuae you keep tying to us it a C
>>
>> try the following
>>
>> def test(x):
>>  print (id(x)
>>
>> a=100 print (id(a))
>> test(a)
>> a="Oops i was an idiot"
>> print (id(a))
>> test(a)
>>
>> python always passes the object bound to a, not the value of a or a
>> pointer to a
> 
> Yes, and? I colloquially used 'value' instead of 'object', 'id' or
> 'reference'. The latter would added confusion as I'm talking about a
> different kind of reference. And if you get rid of 'id' in your code,
> you will get values displayed.
> 
> But how do you pass something that refers to a itself?
> 
> There are good reasons for wanting to do so. Try writing this function
> in Python:
> 
> def swap(a,b):
>  b,a = a,b
> 
> x="one"
> y="two"
> swap(x,y)
> 
> print (x,y)
> 
> so that it displays "two" "one".

Why would i do somthing so pointless?
)
how does this grab you (it often catches newbies out)

def test(x):
a.append('oops')

a=['a list']
test(a)
print (a)

I sugest you may want to start reading a good python tutorial.
 





-- 
Between 1950 and 1952, a bored weatherman, stationed north of Hudson
Bay, left a monument that neither government nor time can eradicate.
Using a bulldozer abandoned by the Air Force, he spent two years and
great effort pushing boulders into a single word.

It can be seen from 10,000 feet, silhouetted against the snow.
Government officials exchanged memos full of circumlocutions (no Latin
equivalent exists) but failed to word an appropriation bill for the
destruction of this cairn, that wouldn't alert the press and embarrass
both Parliament and Party.

It stands today, a monument to human spirit.  If life exists on other
planets, this may be the first message received from us.
-- The Realist, November, 1964.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread Marko Rauhamaa
BartC :

> But how do you pass something that refers to a itself?
>
> There are good reasons for wanting to do so. Try writing this function
> in Python:
>
> def swap(a,b):
> b,a = a,b

Have you tried writing same function in Java? Java is a hugely
successful, highly performant programming language that suffers from the
same "flaw." It doesn't allow you to call functions by reference.

Python has it easier because multiple values can be returned in a tuple,
but ad hoc tuples don't exist in Java. Thus, arrays are commonly used to
implement a sort of pass-by-reference. Here's how to demonstrate the
idea in Python:

   def swap(aref, bref):
   aref[0], bref[0] = bref[0], aref[0]

   x = "one"
   y = "two"
   xref = [x]
   yref = [y]
   swap(xref, yref)
   x = xref[0]
   y = yref[0]
   print(x, y)


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Seekable files

2016-03-15 Thread Steven D'Aprano
Suppose somebody passes me an open file handle. What's the right way to tell
if it is seekable in Python 2?

I see that stdin has a seek and tell method, but they raise:

py> sys.stdin.tell()
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 29] Illegal seek

Are seek and tell guaranteed to exist on all files?

Is there some other way to tell whether the file supports seeking other than
to try it and see?


(In Python 3, files have a seekable method.)


-- 
Steven

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


Fetch Gmail Archieved messages

2016-03-15 Thread Arshpreet Singh
Hi, I am using imaplib to fetch Gmail's Inbox Archived message but results are 
not that much accurate. Here is code+logic:


def inbox_week():
import imaplib
EMAIL = 'myusern...@gmail.com'
PASSWORD = 'mypassword'
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login(  EMAIL, PASSWORD )
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.select("[Gmail]/All Mail")
interval = (date.today()-timedelta(d)).strftime("%d-%b-%Y")
_, data = mail.uid('search', None,'(SENTSINCE{date})'.format(date=interval))

for num in data[0].split():
_, data = mail.uid('fetch', num, '(BODY.PEEK[])')

for response_part in data:
if isinstance(response_part, tuple):
msg = email.message_from_string(response_part[1])
for header in ['to']:
   
# This is logic for inbox-archieved messages
if (EMAIL in str(msg[header]) in str(msg[header])):

main_tuple = email.utils.parsedate_tz(msg['Date'])   

yield main_tuple

I am not sure how to get the list of only Inbox-messages as well as Sentbox 
messages from [All-mail]. Do I need to any other library ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Steven D'Aprano  wrote:
> Suppose somebody passes me an open file handle. What's the right way to tell
> if it is seekable in Python 2?
>
> I see that stdin has a seek and tell method, but they raise:
>
> py> sys.stdin.tell()
> Traceback (most recent call last):
>   File "", line 1, in 
> IOError: [Errno 29] Illegal seek
>
> Are seek and tell guaranteed to exist on all files?

Expecting strict object types isn't really how Python works - while
all subclasses of 'file' are guaranteed to have methods called 'seek'
and 'tell' (although they're not of course guaranteed to do anything
useful), most Python code that says it expects a 'file' doesn't really
mean it wants a subclass of 'file', it means it wants something that
provides a certain subset of the usual file-like methods.

So the answer to your question rather depends on what you mean by
"guaranteed to exist" and "all files". Even actual standard 'file'
objects, while having 'seek' and 'tell', may well just throw an
exception if you try and call those methods as the underlying
operating system file handle the object is attached to does not
support seeking.

> Is there some other way to tell whether the file supports seeking other than
> to try it and see?

No.

> (In Python 3, files have a seekable method.)

Yes, but all it is is a wrapper that does try-it-and-see for you.

I'd just do something like:

  try:
  fileobj.seek(where-i-want-to-seek-to)
  except (AttributeError, EnvironmentError):
  # file is not seekable
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple exercise

2016-03-15 Thread Oscar Benjamin
On 14 March 2016 at 23:59, Steven D'Aprano  wrote:
> On Tue, 15 Mar 2016 02:06 am, Oscar Benjamin wrote:
>
>> On 14 March 2016 at 14:35, Rick Johnson 
>> wrote:
>>>
>>> I would strongly warn anyone against using the zip function
>>> unless
>> ...
>>> I meant to say: absolutely, one hundred percent *SURE*, that
>>> both sequences are of the same length, or, absolutely one
>>> hundred percent *SURE*, that dropping values is not going to
>>> matter. For that reason, i avoid the zip function like the
>>> plague. I would much rather get an index error, than let an
>>> error pass silently.
>>
>> I also think it's unfortunate that zip silently discards items.
>
> Are you aware of itertools.zip_longest?

I am.

> That makes it easy to build a zip_strict:
>
> def zip_strict(*iterables):
> pad = object()
> for t in itertools.zip_longest(*iterables, fillvalue=pad):
> if pad in t:
> raise ValueError("iterables of different length")
> yield t

There are many ways to build a zipstrict. As I said in my own usage of
zip I would almost always want it to raise an error because I almost
always give zip iterables of the same length. However the situation
where zipstrict would benefit is often the kind of situation where
you're not really thinking about the fact that zip truncates. Also if
you only have one zip call in a script it'd be easier (and clearer) to
write:

if len(x) != len(y):
raise ValueError

> Unfortunate or not, it seems to be quite common that "zip" (convolution)
> discards items when sequences are of different lengths. I think the usual
> intent is so that you can zip an infinite (or near infinite) sequence of
> counters 1, 2, 3, 4, ... with the sequence you actually want, to get the
> equivalent of Python's enumerate().

That's fine but in the Python code I see zip is much more often used
with equal length finite iterables than with infinite ones. One of the
things I like about Python (especially since I'm learning JS right
now) that you can write your code in the obvious way and then most of
your error checking comes for free: I want loud error messages instead
of corrupted data. I would rather have the potentially bug-prone
zip_shortest be an opt-in itertools feature and zip_strict the default
behaviour for zip. I realise it's not going to change but I think it
would be better.

--
Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote:
> Rustom Mody wrote:
> 
> > Others have answered some parts
>  if x in x_list:
> > ... print("That is a fruit.")
> > ... else:
> > ... print("That is not a fruit.")
> > ...
> > 
> > However one can distribute the print out of the if; Thus
> > 
>  "This is %s a fruit" % ("" if x in x_list else "not")
> 
> Which of the two versions will most readers grasp at first sight?
> Which one is easier to modify so that it works for arbitrary attributes?
> Which one is easier to internationalize?

Heh!
I think you are saying that my (last) version is clever in a rather stupid
sort of way. Yes?
Well if that is what someone recommends for serious programming then guilty
as charged

But there is a world of difference between
- What one SHOULD (or not) do
- What one CAN do

The first is about serious|professional software engineering
The second is about getting an education beyond basic to some more familiarity

I assumed that OP is in the noob stage and was welcome some learning.
So what I wanted to convey is not so much that such expressions are nice to
have in serious code. Rather that
1. Like algebra has laws so does programming
2. That these laws can be used to massage one program into another
3. That expressions (like %-format) can occur elsewhere than in prints
4. That prints are usually unnecessary (and an abomination)

Not that 3 and 4 come out so well as 1,2 in the above example.

However to answer your questions specifically.

Internationalization: Terrible
Arbitrary attributes: not sure what you are referring to
Readability: Very much like beauty -- in the eye of the beholder
Some things are universally beautiful; some only in some cultural contexts
Likewise readability

Partly people find if-expressions unreadable because they are not used to them.
This is backward because expressions are as basic than statements  -- if
anything more basic.

It is *symmetric*  Unfortunately understood as lopsided
More such symmetries in this table:
http://blog.languager.org/2016/01/primacy.html#expstat

Partly python if-expressions are unreadable because they are backward compared
to if-statements. A minor syntactic nuisance but yes it does impact readability
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Seekable files

2016-03-15 Thread Marko Rauhamaa
Jon Ribbens :

> I'd just do something like:
>
>   try:
>   fileobj.seek(where-i-want-to-seek-to)
>   except (AttributeError, EnvironmentError):
>   # file is not seekable

Unlike Java, Python does not declare syntactically which exceptions the
caller should expect. Unfortunately, the library documentation is not
clear on it, either. So it is often a bit difficult to write proper
try-except logic around a function.

Having to specify the possible exceptions in Java is very painful and
has complicated the introduction of closures to Java quite a bit. I
think it points to a big practical problem in the whole exception
paradigm. Makes you wonder if the old error code mechanism would have
been better, after all. ("Why does Go not have exceptions?" https://golang.org/doc/faq>.)


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Python Advanced Help

2016-03-15 Thread Luke Charlton
Okay, So basically I created a python script around 1 year ago to grab an 
explain_plan from a Greenplum system (Normal SQL) and change it around and 
explain each step/section, the thing is, I've came back to the python code and 
I don't understand anything of what it's doing (the code specifically). The 
Script does work but I just want to explain each section to myself and 
understand it a bit more as I've forgot Python. This means putting 
comments/notes in next to each section to explain it but hidden so it doesn't 
show up when ran, so using the # commenting out #.


The aim of the script is to make the explain_plan understandable because it 
comes out all garbled, so i've turned it upside down because thats how you read 
it, it goes from bottom to top instead of the default top to bottom. I've put 
step 1/2 in etc... but I want to know in the code what does what and where etc 
so I can then expand on the explanation of the explain_plan.

Code (Python) - http://pastebin.com/sVhW34fc (This is the one I'm trying to 
understand)
Before & After of an Explain_Plan in SQL Greenplum - 
http://pastebin.com/81kNWVcy

What we're aiming for (Teradatas Explain_Plan) - http://pastebin.com/Nm4g12B3


Regards,

Luke Charlton
Technical Consultant

[cid:4BEA1319-4F97-4ED8-96FE-1A3EDF7DEC22]
lcharl...@vldbsolutions.com
Mobile : +44 (0) 773 431 3140
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC

On 15/03/2016 01:55, Steven D'Aprano wrote:

On Tue, 15 Mar 2016 04:53 am, BartC wrote:




I get it. The author doesn't like switch statements!


I don't think you do -- there's no "the author". It's a wiki. There's
potentially *thousands* of "authors". The page you (might have) read is a
discussion between many different people, debating the pros and cons of
switches.


I got the impression it was mostly cons, and that everyone was keen to 
replace them with OO constructs.



But they can be a succinct and convenient way of expressing some code
patterns.



One of the problems with switch statements is that they are *anything but*
succinct. Compare this:


switch X
when A,B   then S1
when C then S2
when D,E,F then S3
elseS4
end switch


to the object-oriented solution, using polymorphism:

X.foo()

where foo returns S1, S2, ... S4 as appropriate, according to the type of X.


(1) X.foo only looks more succinct because you've conveniently removed 
A..F and S1..S4. Presumably they have to be provided somewhere else.


(2) My version switches on the *value* of X not the type. (Except of 
course when you use switch type(X) then X.foo() might be better, *if* 
you've done the prerequisite work of setting up the classes and methods 
needed.)



there have been two proposals to introduce a
switch/case statement to Python, including one by Guido himself.

https://www.python.org/dev/peps/pep-3103/


Which starts by saying it's been rejected. But when you read the rest, 
you can sort of understand why! So many complications are put forward, 
and some half-depend on the introduction of constants, that there is no 
clear single solution. It comes across as a mess.



The typical characteristics - when A to F are known at compile-time - are:

* X is only evaluated once


That's easy to emulate with a temporary variable.


You mean when X is complex? Sure, but Python is such that even with a 
local temporary, evaluating LOAD_FAST is needed before each test, with 
all the reference counting that goes with it. And a STORE_FAST before 
the lot. (And some switch statements may be outside a function.)


(My byte-code uses special switch compare operators that leave the test 
value on the stack.)



* None of A to F need to be evaluated
* Only a single test is needed, no matter how many case expressions


How does the compiler know which case matches from a single test?

I think that you might be assuming that the switch statement uses a jump
table. In your case, since you wrote the language, you might be right, but
that's certainly not the case in general.


Not in general, but, in my code at least, testing an integer value 
against a set of integer constants (literals, enums, named constants) is 
used extensively. And things such as enums tend to have a compact span 
of values.


And where a jump-table is not possible, then you just have to locate one 
integer value within a list of constant integers (with a label 
associated with each), and there are many ways to do that. Via hashing 
for example, which would be done in the interpreter and would still 
count as a single test.



But of course, in Python any switch statement would have to support values
of any and every type, not just integers. So any implementation you are
thinking of would have to support cases like this:


switch obj:
 case "Hello", None: ...
 case [1, 2, 3]: ...
 case 23.01, 15+2j, Fraction(10, 11): ...
 case 100**100, {}: ...


and more. This is not negotiable: having a switch statement limited to small
ints is simply not an option.


Not a problem: http://pastebin.com/qdQintSZ


This syntax I find interesting, although it is rather limited in that you
can only switch on integers:


(I use switch-when for integer-only and case-when for anything else, or 
when a jumptable is not viable. See above paste.)



Here's another pattern, which can also be implemented with an underlying
switch:

   X = (N |A, B, C, ... |Z)

This selects the N'th value from A, B, C (in Python, probably 0-based).
Z is the default if N is out of range. A, B, C can be any expressions.

The main characteristic is that only *one* of A, B, C  or Z evaluated,
which is the difference between just using a list.


Are there any well-known languages which support this or similar syntax?


I pinched this syntax from Algol-68. (I think 'when' comes from Ada.)


Of course, the syntax won't work in Python, because ( ... ) is already used
for tuples, and N|A would be ambiguous with bitwise-or. The closest we have
in Python would be:


Is ¦ available? Then (N¦A,B,C¦Z) would work, but is more fiddly to type. 
But the syntax is not important; you could just use:


   select n in a,b,c,d else z

(I think Algol68, when not using the compact form, used case n in a,b,c 
out z esac or some such thing.)


--
Bartc



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


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC

On 15/03/2016 09:20, alister wrote:


Why would i do somthing so pointless?


Name references are pointless? OK, you're the expert ...


how does this grab you (it often catches newbies out)

def test(x):
a.append('oops')

a=['a list']
test(a)
print (a)


Not any more.



I sugest you may want to start reading a good python tutorial.


Last year I started implementing a Python clone. I stopped the project 
because it meant losing too many features I was used to. Also I had 
doubts whether I could even make it as fast as CPython (which had a 
25-year head start).


I've since introduced some aspects of Python (object references) into an 
existing language, while still keeping name references.


Anyway, what I'm saying is, trying to implement a language is also a 
good way of learning it, especially of finding out how it works.


--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:02 PM, BartC  wrote:
> Anyway, what I'm saying is, trying to implement a language is also a good
> way of learning it, especially of finding out how it works.

Same goes for a lot of things. Want to know how Windows ticks? Try
reimplementing it - or read the comments left behind by people who've
done that, by browsing the Wine sources. There have been times when
I've been trying to figure out how to use a particular Windows API
function or window message, and couldn't understand some edge case
based solely on the docs, so I dug into the Wine source code, found
how they did it (and in at least one case, found a comment stating
that observed behaviour differed from the docs!), and was able to
deploy to Windows on that basis.

I'm sure implementing Python is a lot more fun than reimplementing Windows APIs!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Marko Rauhamaa  wrote:
> Jon Ribbens :
>> I'd just do something like:
>>
>>   try:
>>   fileobj.seek(where-i-want-to-seek-to)
>>   except (AttributeError, EnvironmentError):
>>   # file is not seekable
>
> Unlike Java, Python does not declare syntactically which exceptions the
> caller should expect. Unfortunately, the library documentation is not
> clear on it, either. So it is often a bit difficult to write proper
> try-except logic around a function.

This is true, although I'm not sure why you are mentioning it here
since I'm fairly sure the above code suggestion is reasonably correct
and the documentation is pretty clear.

> Having to specify the possible exceptions in Java is very painful and
> has complicated the introduction of closures to Java quite a bit.

It is one of the extremely serious design errors in Java, I think.

> I think it points to a big practical problem in the whole exception
> paradigm.

Well, no. That one individual language screwed up its implementation
of exceptions does not mean the whole concept of exceptions is broken.

> Makes you wonder if the old error code mechanism would have
> been better, after all. ("Why does Go not have exceptions?"  https://golang.org/doc/faq>.)

I think they are wrong, and indeed their argument seems to be a
ludicrous one based upon a misunderstanding of the English meaning of
the word "exception"!

Any high-level language that does not include exceptions is not fit
for purpose, in my opinion.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Seekable files

2016-03-15 Thread Marko Rauhamaa
Jon Ribbens :

> On 2016-03-15, Marko Rauhamaa  wrote:
>> Having to specify the possible exceptions in Java is very painful and
>> has complicated the introduction of closures to Java quite a bit.
>
> It is one of the extremely serious design errors in Java, I think.
>
>> I think it points to a big practical problem in the whole exception
>> paradigm.
>
> Well, no. That one individual language screwed up its implementation
> of exceptions does not mean the whole concept of exceptions is broken.

Python and Java make two.

>> Makes you wonder if the old error code mechanism would have
>> been better, after all. ("Why does Go not have exceptions?" > https://golang.org/doc/faq>.)
>
> I think they are wrong, and indeed their argument seems to be a
> ludicrous one based upon a misunderstanding of the English meaning of
> the word "exception"!
>
> Any high-level language that does not include exceptions is not fit
> for purpose, in my opinion.

I reserve my judgement for now. However, let it be said that exceptions
are supposed to make the code flow better. Instead, they are often
making code awkward-looking and "bouncy."


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Marko Rauhamaa  wrote:
> Jon Ribbens :
>> On 2016-03-15, Marko Rauhamaa  wrote:
>>> I think it points to a big practical problem in the whole exception
>>> paradigm.
>>
>> Well, no. That one individual language screwed up its implementation
>> of exceptions does not mean the whole concept of exceptions is broken.
>
> Python and Java make two.

Except Python didn't screw up its implementation of exceptions at all.
That the documentation could be better doesn't make it "broken".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OTish Wells Fargo sucks

2016-03-15 Thread Grant Edwards
On 2016-03-14, Seymore4Head  wrote:

> Wells Fargo online will not allow you to change a payee's address. You
> have to delete the account and re enter it.

Wells Fargo is a pretty large company with a lot of money to spend.

How difficult a web site is to use is proportional to the size of
organization that owns it and how much money they spent developing it.

That's also why the national health insurance marketplace web site was
such a debacle.

-- 
Grant Edwards   grant.b.edwardsYow! I just remembered
  at   something about a TOAD!
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC

On 15/03/2016 11:52, BartC wrote:

On 15/03/2016 01:55, Steven D'Aprano wrote:



switch obj:
 case "Hello", None: ...
 case [1, 2, 3]: ...
 case 23.01, 15+2j, Fraction(10, 11): ...
 case 100**100, {}: ...


and more. This is not negotiable: having a switch statement limited to
small
ints is simply not an option.


Not a problem: http://pastebin.com/qdQintSZ


The solution I posted tested the values one after another. I was 
interested in whether it was that much faster than if-elif in CPython 3, 
so I tried the test similar to that below, except that k, c and f were 
literal values in the loop to start with.


Initial timings were 5 seconds for mine, 12.5 seconds for Python. That's 
in line with what I expected when dealing with more complex objects.


However, I then took the 100**100 outside the loop in my version (as 
that expression was not reduced to a constant). The timing then reduced 
to 170ms (I have a slow big num library).


But doing the same with Python made no difference. Taking Complex and 
Fraction outside reduced the timing to 8 seconds, still 50 times slower.


(My language doesn't understand Complex and Fraction, so testing against 
those is a quick process. Taking those out completely as well as 
100**100 made a difference, but there was the same discrepancy)


I know my language isn't that fast, so something is slowing down the 
Python in this test (and I don't /think/ I've left a zero out in my 
version!)


So maybe it makes the case for a proper Switch in Python stronger where 
such comparisons could be streamlined.



from fractions import Fraction

def test():

data=["Hello",None,[1,2,3],23.01,15+2j,Fraction(10,11),100**100,{},12345]
#print (data)
k=100**100
c=15+2j
f=Fraction(10,11)

for n in range(10):
for obj in data:
if obj=="hello" or obj==None:
pass
elif obj==[1,2,3]:
pass
elif obj==23.01 or obj==c or obj==f:
pass
elif obj==k or obj=={}:
pass


test()


--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: common mistakes in this simple program

2016-03-15 Thread Ganesh Pal
On Tue, Mar 1, 2016 at 2:41 AM, Martin A. Brown  wrote:

> Please read below.  I will take a stab at explaining the gaps of
> understanding you seem to have (others have tried already, but I'll
> try, as well).
>
> I am going to give you four different functions which demonstrate
> how to use exceptions.  You may find it instructive to paste these
> functions into an interactive Python shell and try them out, as
> well.
>

Thanks Martin for beautifully demonstrating the use of exception  with
an example that's easy to understand.

Step 1: catch a specific Exception
Step 2: catch a specific Exception
Step 3: catch several different classes of Exception
Step 4: catch many different classes of Exception
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fetch Gmail Archieved messages

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 5:48:15 AM UTC-5, Arshpreet Singh wrote:

> def inbox_week():
> import imaplib
> EMAIL = 'myusern...@gmail.com'

I admit that this is pedantic, but you should really use
ADDRESS instead of EMAIL. ADDRESS more correctly complements
PASSWORD. But in any event, you did do well by spelling them
as constants, which implicitly means: "Hey, don't mutate
these values!"

> PASSWORD = 'mypassword'
> mail = imaplib.IMAP4_SSL('imap.gmail.com')
> mail.login(  EMAIL, PASSWORD )
> mail = imaplib.IMAP4_SSL('imap.gmail.com')
> mail.select("[Gmail]/All Mail")
> interval = (date.today()-timedelta(d)).strftime("%d-%b-%Y")
> _, data = mail.uid('search', 
> None,'(SENTSINCE{date})'.format(date=interval))
> 
> for num in data[0].split():
> _, data = mail.uid('fetch', num, '(BODY.PEEK[])')
> 
> for response_part in data:
> if isinstance(response_part, tuple):
> msg = email.message_from_string(response_part[1])
> for header in ['to']:
>
> # This is logic for inbox-archieved messages
> if (EMAIL in str(msg[header]) in str(msg[header])):

Is that last line doing what you think it's doing? Let's
break it down... Basically you have one condition, that is
composed of two main components:

Component-1: EMAIL in str(msg[header])

and 

Component-2: str(msg[header])
 

"Component-1" will return a Boolean. So in essence you're
asking:

boolean = EMAIL in str(msg[header])
if boolean in str(msg[header]):
do_something()
 
Is that really what you wanted to do? I'm not sure how you
will ever find a Boolean in a string. Unless i've missed
something...? It will also help readability if you only 
applied str() to the value *ONCE*. But, maybe you don't 
even need the str() function???

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


Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Peter Otten
Rustom Mody wrote:

> On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote:
>> Rustom Mody wrote:
>> 
>> > Others have answered some parts
>>  if x in x_list:
>> > ... print("That is a fruit.")
>> > ... else:
>> > ... print("That is not a fruit.")
>> > ...
>> > 
>> > However one can distribute the print out of the if; Thus
>> > 
>>  "This is %s a fruit" % ("" if x in x_list else "not")
>> 
>> Which of the two versions will most readers grasp at first sight?
>> Which one is easier to modify so that it works for arbitrary attributes?
>> Which one is easier to internationalize?
> 
> I think you are saying that my (last) version is clever in a rather stupid
> sort of way. Yes?

Well, yes ;)

> Well if that is what someone recommends for serious programming then
> guilty as charged
> 
> But there is a world of difference between
> - What one SHOULD (or not) do
> - What one CAN do
> 
> The first is about serious|professional software engineering
> The second is about getting an education beyond basic to some more
> familiarity
> 
> I assumed that OP is in the noob stage and was welcome some learning.
> So what I wanted to convey is not so much that such expressions are nice
> to have in serious code. Rather that
> 1. Like algebra has laws so does programming
> 2. That these laws can be used to massage one program into another
> 3. That expressions (like %-format) can occur elsewhere than in prints

That (the % part) is a lesson for C programmers rather than newbies ;)

> 4. That prints are usually unnecessary (and an abomination)

They aren't. They are often misused by beginners when they occur where a 
function should return a value.
 
> Not that 3 and 4 come out so well as 1,2 in the above example.
> 
> However to answer your questions specifically.
> 
> Internationalization: Terrible
> Arbitrary attributes: not sure what you are referring to
> Readability: Very much like beauty -- in the eye of the beholder
> Some things are universally beautiful; some only in some cultural contexts
> Likewise readability
> 
> Partly people find if-expressions unreadable because they are not used to
> them.
> This is backward because expressions are as basic than statements  -- if
> anything more basic.

I think the problem is not that you prefer a programming paradigm that is 
not Python's default -- it's that you crammed too many ideas into one 
example. It's probably most helpful to concentrate on your main point, e. g.

(You can) Use an expression:

>>> x = "flying saucer"
>>> "This is a fruit" if x in x_list else "This is not a fruit"
'This is not a fruit'

> It is *symmetric*  Unfortunately understood as lopsided
> More such symmetries in this table:
> http://blog.languager.org/2016/01/primacy.html#expstat
> 
> Partly python if-expressions are unreadable because they are backward
> compared to if-statements. A minor syntactic nuisance but yes it does
> impact readability

Indeed. It's still better than

"This is %s a fruit" % (x in x_list and "" or "not")

The bug is intentional; the fix is of course

"This is %s a fruit" % (x in x_list and "most likely" or "probably not")

;)

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


Re: Python Advanced Help

2016-03-15 Thread Peter Otten
Luke Charlton wrote:

> Okay, So basically I created a python script around 1 year ago to grab an
> explain_plan from a Greenplum system (Normal SQL) and change it around and
> explain each step/section, the thing is, I've came back to the python code
> and I don't understand anything of what it's doing (the code
> specifically). The Script does work but I just want to explain each
> section to myself and understand it a bit more as I've forgot Python. This
> means putting comments/notes in next to each section to explain it but
> hidden so it doesn't show up when ran, so using the # commenting out #.
> 
> 
> The aim of the script is to make the explain_plan understandable because
> it comes out all garbled, so i've turned it upside down because thats how
> you read it, it goes from bottom to top instead of the default top to
> bottom. I've put step 1/2 in etc... but I want to know in the code what
> does what and where etc so I can then expand on the explanation of the
> explain_plan.
> 
> Code (Python) - http://pastebin.com/sVhW34fc (This is the one I'm trying
> to understand) Before & After of an Explain_Plan in SQL Greenplum -
> http://pastebin.com/81kNWVcy
> 
> What we're aiming for (Teradatas Explain_Plan) -
> http://pastebin.com/Nm4g12B3

You are about to learn a valuable lesson early in your programming career:

Throw away convoluted code that while trying to solve a simple problem is 
hard to follow.

Instead take the time necessary to read an introductory text on Python. Then 
describe the problem you want to solve in plain English. 

Finally translate the English into Python. Use descriptive variable names. 
If you run into problems that you cannot solve yourself come back here or 
ask on the tutor mailing list.

I expect that the resulting script will need only the input file and one 
list to reverse its lines, but no temporary files.

You may even be able to still understand it next year ;)

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


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 7:21:02 AM UTC-5, Chris Angelico wrote:
> I'm sure implementing Python is a lot more fun than reimplementing 
> Windows APIs!

There's not much on this earth, that is worse than Windows APIs.


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


Re: OTish Wells Fargo sucks

2016-03-15 Thread MRAB

On 2016-03-15 14:37, Grant Edwards wrote:

On 2016-03-14, Seymore4Head  wrote:


Wells Fargo online will not allow you to change a payee's address. You
have to delete the account and re enter it.


Wells Fargo is a pretty large company with a lot of money to spend.

How difficult a web site is to use is proportional to the size of
organization that owns it and how much money they spent developing it.

That's also why the national health insurance marketplace web site was
such a debacle.

After the failure of "NHS Connecting for Health" 
(https://en.wikipedia.org/wiki/NHS_Connecting_for_Health), the UK 
government got its act together with the "Government Digital Service" 
(https://en.wikipedia.org/wiki/Government_Digital_Service). It no longer 
tries to do everything in one go.


Failure is not inevitable.

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


Re: Python Advanced Help

2016-03-15 Thread Thomas 'PointedEars' Lahn
Luke Charlton wrote:

> Okay, So basically I created a python script around 1 year ago to grab an
> explain_plan from a Greenplum system (Normal SQL) and change it around and
> explain each step/section, the thing is, I've came back to the python code
> and I don't understand anything of what it's doing (the code
> specifically).

OK, so, basically, RTFM and STFW.  Also, you can print($object.__doc__) for 
each $object that you do not understand.

> The Script does work but I just want to explain each section to myself and
> understand it a bit more as I've forgot Python. This means putting
> comments/notes in next to each section to explain it but hidden so it
> doesn't show up when ran, so using the # commenting out #.

It is sufficient for Python single-line comments if the line starts with “#” 
(optionally preceded by whitespace).  Everything else is decoration.
I use leading “##” and “###” to tell documentation comments (other than 
docstrings) from comment lines that disable code (lines starting with “#” 
only) before it is cleaned up.  (WFM.  There might be a PEP about this that 
recommends otherwise.)
 
> […]
> Code (Python) - http://pastebin.com/sVhW34fc (This is the one I'm trying
> to understand) Before & After of an Explain_Plan in SQL Greenplum -
> http://pastebin.com/81kNWVcy
> 
> What we're aiming for (Teradatas Explain_Plan) -
> http://pastebin.com/Nm4g12B3



-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC

On 15/03/2016 14:58, BartC wrote:

On 15/03/2016 11:52, BartC wrote:

On 15/03/2016 01:55, Steven D'Aprano wrote:



switch obj:
 case "Hello", None: ...
 case [1, 2, 3]: ...
 case 23.01, 15+2j, Fraction(10, 11): ...
 case 100**100, {}: ...


and more. This is not negotiable: having a switch statement limited to
small
ints is simply not an option.


Not a problem: http://pastebin.com/qdQintSZ


The solution I posted tested the values one after another. I was
interested in whether it was that much faster than if-elif in CPython 3,



data=["Hello",None,[1,2,3],23.01,15+2j,Fraction(10,11),100**100,{},12345]



> ... so something is slowing down the Python in this test

The culprit here was Fraction. Whatever Fraction does, it's slow! And 
when removed from the test expressions, it was still in the data list.


Replacing Fraction with a dummy class gave a more reasonable timing of 
1.5 seconds (compared with 0.17s for the external language using 
'general' switch, and 0.28s when it also uses an if-else chain).


--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote:

> Swanand Pashankar  writes:
>> Embedding a Python file in C code works, but it exposes your Python
>> script. Didn't find any free fool-proof way to obfuscate Python code
>> either.
> 
> What exactly is it you want to prevent? Why do you think obfuscating the
> code will achieve that?

On a more constructive note, python(1) (CPython) creates a binary (byte-
code) “.pyc” file from “.py” files when it runs them.  ISTM that you can 
then run the “.pyc” file as if it were the “.py” file (if the “.pyc” file is 
given the executable flag, you can even execute it as a standalone command, 
but that might only work on my system).  So apparently you do not have to 
distribute the source code of a program written in Python if you do not want 
to.

If you want to distribute the “.pyc” file (perhaps under another name), then 
the “-O” and “-OO” optimization switches for python(1) could come in handy 
(see “python --help”).  [It is then perhaps not a coincidence that “-O” is 
documented to change the filename suffix from “.pyc” to “.pyo”; cf. “.so”]

(The Python manual should have more on this, I have not checked.)

That said, not distributing the source code of a program as well (or at 
least making it available to users in some way) strikes me as unpythonic 
since Python is at least Open Source software, and Python 2.0.1, 2.1.1 and 
newer are GPL-compatible Free Software.




-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OTish Wells Fargo sucks

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 9:38:16 AM UTC-5, Grant Edwards wrote:
> How difficult a web site is to use is proportional to the
> size of organization that owns it and how much money they
> spent developing it.

I would also add: "The quality of the engineers who design
and implement it". This is actually the most import part!
You can't just throw money at a project and assume it's
quality will increase proportionally. Money creates more
problems than it solves.

> That's also why the national health insurance marketplace
> web site was such a debacle.

The "debacle", or "evil", existed long before the
marketplace did, and it goes by the name of "Politics".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OTish Wells Fargo sucks

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 1:23:58 PM UTC-5, MRAB wrote:
> Failure is not inevitable.

Inevitable? No. 

Highly probable? Yes.

(This message sponsored by: The Magic Eight Ball)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Different sources of file

2016-03-15 Thread Wildman via Python-list
On Mon, 14 Mar 2016 20:56:44 +, Val Krem wrote:

> #!/usr/bin/python

On some Linux systems python is installed in /usr/local/bin.
I would suggest using the hash-bang below.  It will insure
python will run no matter where it was installed.

#!/usr/bin/env python

-- 
 GNU/Linux user #557453
May the Source be with you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Obfuscating Python code

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn
 wrote:
> That said, not distributing the source code of a program as well (or at
> least making it available to users in some way) strikes me as unpythonic
> since Python is at least Open Source software, and Python 2.0.1, 2.1.1 and
> newer are GPL-compatible Free Software.

gcc is also free software. Does that mean that all C programs should
be free software? No.

However, since all software can be reverse-compiled (particularly
byte-code like .pyc files), the only truly reliable way to make
completely closed software is to restrict access to it in all forms.
In today's world, that usually means providing it as a web service.
Otherwise, you have to assume that anyone can see your source. The
only difference between open-source and closed-source is the license,
not the ability to see stuff.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Case Statements

2016-03-15 Thread jj0gen0info
Given that "Case Statements" are more compact and less redundant than a 
sequence of if-elif statements, and usually can contain embedded match lists:
Is there any chance future versions of Python will adopt a case structure?

Something like

select x
   case in [1,2,3,5,7,9]
   print 
   case in [4,6,8]
   print 
   case else
   print 

Just a thought.

JJ
-- 
https://mail.python.org/mailman/listinfo/python-list


WP-A: A New URL Shortener

2016-03-15 Thread Vinicius Mesel
Hey guys,

I'm a 16 year old Python Programmer that wanted to do something different.
But, like we know, ideas are quite difficult to find.
So I decided to develop a URL Shortener to help the Python community out and 
share my coding knowledge, and today the project was launched with its first 
stable version.
So if you want to see the software working, go check it out at: http://wp-a.co/
Or if you want to see the source code to contribute and help the project: 
https://github.com/vmesel/WP-A.CO


Hugs,
Vinicius Mesel
Brazilian and Portuguese Speaker
http://www.vmesel.com



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


Re: Encapsulation in Python

2016-03-15 Thread Christian Gollwitzer

Am 14.03.16 um 23:40 schrieb BartC:

On 14/03/2016 22:20, Mark Lawrence wrote:
 > The RUE kept stating that he was an expert in unicode, but never once
 > provided a single shred of evidence to support his claim.  Until I see
 > substantiated evidence from you I am going to state quite cleary that
 > you've no idea, you're just another RUE.

Sorry, I'm not going to do that, and I don't expect anyone here to have
to do so either. You will have to take my posts as they are.


I don't think that you make things up, your posts are much too detailed 
and plausible to be made up. Nevertheless, why don't you setup a 
repository on an open source server, say github, and post your language 
implementation there? Actually I would try it out to see how it compares 
to other dynamic languages, especially since you do not use JIT 
compilation to native code, but still claim that you get good 
performance. You will also profit (in the form of bug reports) if 
somebody actually tries your code.


Christian


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


Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote:

> On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn
>  wrote:
>> That said, not distributing the source code of a program as well (or at
>> least making it available to users in some way) strikes me as unpythonic
>> since Python is at least Open Source software, and Python 2.0.1, 2.1.1
>> and newer are GPL-compatible Free Software.
> 
> gcc is also free software. Does that mean that all C programs should
> be free software? No.

IMNSHO, yes.  At the very least because in using gcc you benefited from the 
free software community, so you should give back to the free software 
community accordingly.

> However, since all software can be reverse-compiled (particularly

You mean _decompiled_.

> byte-code like .pyc files),

Yes, it is easier with bytecode *if you know the VM*.

> the only truly reliable way to make completely closed software is to 
> restrict access to it in all forms.

ACK.

> In today's world, that usually means providing it as a web service.

ACK.  That’s why RMS calls it SaaSS, Service as a Software Substitute :)

> Otherwise, you have to assume that anyone can see your source. The
> only difference between open-source and closed-source is the license,
> not the ability to see stuff.

If that were the case and reverse engineering were an easy task that 
everyone could do, we would have a lot more free software variants of 
proprietary software.  Particularly, we would have a lot less proprietary 
device drivers.  ISTM that you do not know what you are talking about here.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Vinicius Mesel wrote:

> I'm a 16 year old Python Programmer that wanted to do something different.
> But, like we know, ideas are quite difficult to find.
> So I decided to develop a URL Shortener to help the Python community out
> and share my coding knowledge, and today the project was launched with its
> first stable version. So if you want to see the software working, go check
> it out at: http://wp-a.co/ Or if you want to see the source code to
> contribute and help the project: https://github.com/vmesel/WP-A.CO

While I commend your efforts, I think that you should have chosen another 
topic for your project.  It is also hard for me to see in which way this is 
“something different” – are there not enough “URL Shorteners” already? –, 
and how a “URL Shortener” could “help the Python community out”.

Because I think that “URL Shorteners” are a bad idea in the first place: One 
never knows for how long a time a “short URL” works, who is listening in the 
middle, and what they are referring to, until one uses them at which point 
it is too late.  If a “short URL” expires, there is *no way* to retrieve the 
referred content; when a *real* URI breaks, there are services like the 
Internet Archive and the Google cache to help one out.  So when I see a 
“short URL”, I tend not to use it.

I find it particularly disturbing that in wpa.py:processaURL() your software 
apparently stores the original URIs in an SQL database; in the case of your 
proof-of-concept, in *your* database.  So *you* are listening in the middle 
then.  I cannot be sure because I have not thought this through, but with 
aliases for common second-level domains, and with text compression, it 
should be possible to do this without a database.

So sorry, because of that already, I will certainly not use or recommend 
your service.  “Leave others the privacies of their minds and lives. 
Intimacy remains precious only insofar as it is inviolate.” ─Surak

And with the exception of Twitter-ish sites that place a limit on message 
length, there really is *no need* for shorter URIs nowadays.  (HTTP) clients 
and servers are capable of processing really long ones [1]; electronic 
communications media and related software, too [2].  And data storage space 
as well as data transmission has become exceptionally inexpensive.  A few 
less bytes there do not count.

Instead, there *is* a need for *concise*, *semantic* URIs that Web (service) 
users can *easily* *remember*.  It is the duty of the original Web 
authors∕developers to make sure that there are, and I think that no kind of 
automation is going to ease or replace thoughtful path design anytime soon 
(but please, prove me wrong):



__
[1] 
[2] 
-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread Mark Lawrence

On 15/03/2016 20:46, jj0gen0i...@gmail.com wrote:

Given that "Case Statements" are more compact and less redundant than a 
sequence of if-elif statements, and usually can contain embedded match lists:
Is there any chance future versions of Python will adopt a case structure?

Something like

select x
case in [1,2,3,5,7,9]
print 
case in [4,6,8]
print 
case else
print 

Just a thought.

JJ



Been suggested and rejected via 
https://www.python.org/dev/peps/pep-3103/ and 
https://www.python.org/dev/peps/pep-0275/.  The "Rejection Notice" 
section of the former states "A quick poll during my keynote 
presentation at PyCon 2007 shows this proposal has no popular support. I 
therefore reject it.".


See also http://c2.com/cgi/wiki?SwitchStatementsSmell

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik

On 15/03/16 22:53, Thomas 'PointedEars' Lahn wrote:

A few
less bytes there do not count.


You mean "Fewer bytes there do not count".

E.

(But on the whole, yes, I do agree with your position in this instance.
Kudos to Vinicius for doing something productive with his time though - 
I'm sure a lot has been learned in putting that together).

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


Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
 wrote:
> Vinicius Mesel wrote:
>
>> I'm a 16 year old Python Programmer that wanted to do something different.
>> But, like we know, ideas are quite difficult to find.
>> So I decided to develop a URL Shortener to help the Python community out
>> and share my coding knowledge, and today the project was launched with its
>> first stable version. So if you want to see the software working, go check
>> it out at: http://wp-a.co/ Or if you want to see the source code to
>> contribute and help the project: https://github.com/vmesel/WP-A.CO
>
> I find it particularly disturbing that in wpa.py:processaURL() your software
> apparently stores the original URIs in an SQL database; in the case of your
> proof-of-concept, in *your* database.  So *you* are listening in the middle
> then.  I cannot be sure because I have not thought this through, but with
> aliases for common second-level domains, and with text compression, it
> should be possible to do this without a database.

How? If you shorten URLs, you have to be able to reconstruct the long
ones. Compression can't do that to arbitrary lengths. Somewhere there
needs to be the rest of the information.

> And with the exception of Twitter-ish sites that place a limit on message
> length, there really is *no need* for shorter URIs nowadays.  (HTTP) clients
> and servers are capable of processing really long ones [1]; electronic
> communications media and related software, too [2].  And data storage space
> as well as data transmission has become exceptionally inexpensive.  A few
> less bytes there do not count.

There are many places where there are limits (hard or soft) on message
lengths. Some of us still use MUDs and 80-character line limits.
Business cards or other printed media need to be transcribed by hand.
Dictation of URLs becomes virtually impossible when they're
arbitrarily long.

> Instead, there *is* a need for *concise*, *semantic* URIs that Web (service)
> users can *easily* *remember*.  It is the duty of the original Web
> authors∕developers to make sure that there are, and I think that no kind of
> automation is going to ease or replace thoughtful path design anytime soon
> (but please, prove me wrong):

Sure.. if you control the destination server. What if you're
engaging in scholarly discussion about someone else's content? You
can't change the canonical URLs, and you can't simply copy their
content to your own server (either for licensing reasons or to
guarantee that the official version hasn't been tampered with).

So URL shorteners are invaluable tools. However, I'm not sure what
this one is that others aren't.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 5:54:46 PM UTC-5, Thomas 'PointedEars' Lahn wrote:
> Vinicius Mesel wrote:
> > I'm a 16 year old Python Programmer that wanted to do
> > something different. But, like we know, ideas are quite
> > difficult to find. So I decided to develop a URL
> > Shortener to help the Python community out and share my
> > coding knowledge, and today the project was launched
> > with its first stable version.

Although Thomas makes some very valid points, don't let
anybody discourage you Vinicius. If you want to build
something, and everyone in the *ENTIRE* world say's it's a bad
idea, do it anyway -- if for nothing else than to spite
them. :-P

> While I commend your efforts, I think that you should have
> chosen another topic for your project.  It is also hard
> for me to see in which way this is "something different" -
> are there not enough "URL Shorteners" already? -, and how
> a "URL Shortener" could "help the Python community out".

How many Python URL trimmers are there anyway? If none
exist, then he could claim the "i was the first" prize. If
others already exist, no harm, perhaps his implementation
utilizes a unique method of creating these small URLs that
could be a valuable teaching tool. And even if none of these
apply, his contribution is most welcome -- this is an open
community after all.

> Because I think that "URL Shorteners" are a bad idea in
> the first place: One never knows for how long a time a
> "short URL" works, who is listening in the middle, and
> what they are referring to, until one uses them at which
> point it is too late.  If a "short URL" expires, there is
> *no way* to retrieve the referred content; when a *real*
> URI breaks, there are services like the Internet Archive
> and the Google cache to help one out.  So when I see a
> "short URL", I tend not to use it.

I'll have to agree with Thomas here. I avoid them like the
plague for the same reasons. But don't be discouraged by
this, Vinicius, many people use them. Thankfully, not
everyone is as paranoid as Thomas and myself. :-)



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


Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote:

> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
>  wrote:

Attribution *line*, _not_ attribution novel.

>> […] I cannot be sure because I have not thought this through, but with
^^^
>> aliases for common second-level domains, and with text compression, it
>> should be possible to do this without a database.
> 
> How? If you shorten URLs, you have to be able to reconstruct the long
> ones. Compression can't do that to arbitrary lengths. Somewhere there
> needs to be the rest of the information.

First of all, you quoted me out of context.  Please do not do that again.

Second, do you even read what you reply to?  See the markings above.

And as for second-level domains, consider for example “t.c” instead of 
“twitter.com” as part of the short URI.
 
>> And with the exception of Twitter-ish sites that place a limit on message
>> length, there really is *no need* for shorter URIs nowadays.  (HTTP)
>> clients and servers are capable of processing really long ones [1];
>> electronic communications media and related software, too [2].  And data
>> storage space as well as data transmission has become exceptionally
>> inexpensive.  A few less bytes there do not count.
> 
> There are many places where there are limits (hard or soft) on message
> lengths. Some of us still use MUDs and 80-character line limits.

See above.  Covered by [2].

But speaking of length limits, the lines in your postings are too long, 
according to Usenet convention.  I had to correct the quotations so that 
they remained readable when word-wrapped.

> Business cards or other printed media need to be transcribed by hand.
> Dictation of URLs becomes virtually impossible when they're
> arbitrarily long.

(You are not reading at all, are you?)  This is covered by that:
 
>> Instead, there *is* a need for *concise*, *semantic* URIs that Web
>> (service) users can *easily* *remember*.  It is the duty of the original
>> Web authors∕developers to make sure that there are, and I think that no
>> kind of automation is going to ease or replace thoughtful path design
>> anytime soon (but please, prove me wrong):
> 
> Sure.. if you control the destination server. What if you're
> engaging in scholarly discussion about someone else's content? You
> can't change the canonical URLs, and you can't simply copy their
> content to your own server (either for licensing reasons or to
> guarantee that the official version hasn't been tampered with).

That is why I said it is the duty of the original authors/developers.  It is 
a community effort, and it is not going to happen overnight.  But evading 
the problem with unreliable replacements such as “short URLs” is not going 
to solve it either.
 
> So URL shorteners are invaluable tools.

IBTD.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik

Hi Chris,

On 15/03/16 23:16, Chris Angelico wrote:

So URL shorteners are invaluable tools.


Perhaps, and in the specific - transient - use-cases you describe that's 
fine. The problem I have with them is that they are a level of 
indirection controlled by a third party. If the source (let's say this 
list) has a message containing a link to something on the target which 
is still available via a "shortened" URL, then if the shortening service 
goes offline, the link is dead. Even though the target is still there.


People complain about the use of pastebin in this list for showing code 
fragments. It's the same thing - one URL shortening (indirection) 
service goes offline and a ton of links are suddenly silenced. It's like 
a disturbance in the force ;)


FWIW, I also have an issue with services that convert your ASCII text 
into unicode such that the resulting glyphs are still things a human 
reader will understand as substitutes for the original text but which 
can't be easily searched/grepped.


All for saving a byte or two.


However, I'm not sure what
this one is that others aren't.


Vinicius didn't say his code was anything different.

He said he _WANTED_ to do something different _BUT_ realised ideas are 
hard to come by, _SO_ he developed some URL-shortening software and then 
shared it.


I see it as a learning exercise on his part, and that's great.

E.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread jj0gen0info

Thanks for the informative post.  I've read it and disagree with the rational, 
it places Python in a decided minority of the major languages.

https://en.wikipedia.org/wiki/Conditional_(computer_programming)#Case_and_switch_statements

See section "Choice system cross reference"

Thanks again for the reply

JJ
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 10:40 AM, Erik  wrote:
> Hi Chris,
>
> On 15/03/16 23:16, Chris Angelico wrote:
>>
>> So URL shorteners are invaluable tools.
>
>
> Perhaps, and in the specific - transient - use-cases you describe that's
> fine. The problem I have with them is that they are a level of indirection
> controlled by a third party. If the source (let's say this list) has a
> message containing a link to something on the target which is still
> available via a "shortened" URL, then if the shortening service goes
> offline, the link is dead. Even though the target is still there.
>
> People complain about the use of pastebin in this list for showing code
> fragments. It's the same thing - one URL shortening (indirection) service
> goes offline and a ton of links are suddenly silenced. It's like a
> disturbance in the force ;)

I agree, it's a risk. Any indirection adds that. So the benefit has to
be weighed against this inherent cost.

> FWIW, I also have an issue with services that convert your ASCII text into
> unicode such that the resulting glyphs are still things a human reader will
> understand as substitutes for the original text but which can't be easily
> searched/grepped.

Oh, I totally agree. Your text should be your text.

>> However, I'm not sure what
>> this one is that others aren't.
>
>
> Vinicius didn't say his code was anything different.
>
> He said he _WANTED_ to do something different _BUT_ realised ideas are hard
> to come by, _SO_ he developed some URL-shortening software and then shared
> it.

Yeah, but there's usually _something_ different :)

> I see it as a learning exercise on his part, and that's great.

Absolutely. As such, it's excellent. I often like to make a small
change when I reimplement, though - something that I thought was
ill-designed in the original, or maybe just a simple thing of
integration somewhere (eg a little text editor embedded in a larger
program).

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn
 wrote:
> Chris Angelico wrote:
>
>> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
>>  wrote:
>
>>> […] I cannot be sure because I have not thought this through, but with
> ^^^
>>> aliases for common second-level domains, and with text compression, it
>>> should be possible to do this without a database.
>>
>> How? If you shorten URLs, you have to be able to reconstruct the long
>> ones. Compression can't do that to arbitrary lengths. Somewhere there
>> needs to be the rest of the information.
>
> First of all, you quoted me out of context.

I trimmed the context. You got a problem with that?

> Second, do you even read what you reply to?  See the markings above.

Instead of thinking about URL shorteners specifically, think generally
about information theory. You cannot, fundamentally, shorten all URLs
arbitrarily. There just isn't enough room to store the information.

> And as for second-level domains, consider for example “t.c” instead of
> “twitter.com” as part of the short URI.

That'll work only for the ones that you code in specifically, and
that's only shortening your URL by 8 characters. A typical URL needing
shortening is over 80 characters - maybe several hundred. You need to
cut that down to a manageable length. That fundamentally cannot be
reversed without readding information.

>>> And with the exception of Twitter-ish sites that place a limit on message
>>> length, there really is *no need* for shorter URIs nowadays.  (HTTP)
>>> clients and servers are capable of processing really long ones [1];
>>> electronic communications media and related software, too [2].  And data
>>> storage space as well as data transmission has become exceptionally
>>> inexpensive.  A few less bytes there do not count.
>>
>> There are many places where there are limits (hard or soft) on message
>> lengths. Some of us still use MUDs and 80-character line limits.
>
> See above.  Covered by [2].

Unrelated. Not covered by that link. Go use a MUD some time.

> But speaking of length limits, the lines in your postings are too long,
> according to Usenet convention.  I had to correct the quotations so that
> they remained readable when word-wrapped.

Oh, so you'd rather the lines be cut to... I dunno, 80 characters?
Might be a good reason to use a URL shortener.

>> Business cards or other printed media need to be transcribed by hand.
>> Dictation of URLs becomes virtually impossible when they're
>> arbitrarily long.
>
> (You are not reading at all, are you?)  This is covered by that:
>
>>> Instead, there *is* a need for *concise*, *semantic* URIs that Web
>>> (service) users can *easily* *remember*.  It is the duty of the original
>>> Web authors∕developers to make sure that there are, and I think that no
>>> kind of automation is going to ease or replace thoughtful path design
>>> anytime soon (but please, prove me wrong):
>>
>> Sure.. if you control the destination server. What if you're
>> engaging in scholarly discussion about someone else's content? You
>> can't change the canonical URLs, and you can't simply copy their
>> content to your own server (either for licensing reasons or to
>> guarantee that the official version hasn't been tampered with).
>
> That is why I said it is the duty of the original authors/developers.  It is
> a community effort, and it is not going to happen overnight.  But evading
> the problem with unreliable replacements such as “short URLs” is not going
> to solve it either.

So, you can go fight an unwinnable battle against literally every web
creator in the world. Meanwhile, I'll keep on using URL shorteners.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread Mark Lawrence

On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote:


Thanks for the informative post.  I've read it and disagree with the rational, 
it places Python in a decided minority of the major languages.

https://en.wikipedia.org/wiki/Conditional_(computer_programming)#Case_and_switch_statements

See section "Choice system cross reference"

Thanks again for the reply

JJ



If the Python core developers have decided it isn't needed, as perhaps 
explained in my link about the "Switch Statement Code Smell", why worry 
about it?


If you really think you need one start here 
http://code.activestate.com/recipes/269708-some-python-style-switches/


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Missing something about timezones

2016-03-15 Thread Peter Pearson
On Mon, 14 Mar 2016 10:19:23 -0500, Skip Montanaro wrote:
> Is this correct (today, with Daylight Savings in effect)?
>
 import pytz
 i.timezone
> 'America/Chicago'
 pytz.timezone(i.timezone)
>
 ot
> datetime.datetime(2016, 3, 14, 9, 30, tzinfo= 'America/New_York' EDT-1 day, 20:00:00 DST>)
 ot.tzinfo
>


I've stubbed my toe many times on timezones and DST.  Here are
some notes I've accumulated:

 * datetime.datetime(..., tzinfo=tz) doesn't work right for timezones
   that involve daylight-saving time, but nobody gets around to fixing
   it because it's written in C; and

 * knowing this, the creators of pytz thoughtfully furnished a
   workaround, in the form of the "localize" method of a pytz.timezone
   object:

>>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0)) 
>>> print(loc_dt.strftime(fmt))
2002-10-27 06:00:00 EST-0500


$ cat temp2.py
from datetime import datetime
from pytz import timezone

print(str(datetime(2015, 1, 31, 12, tzinfo=timezone("US/Pacific"
print(str(datetime(2015, 7, 31, 12, tzinfo=timezone("US/Pacific"

print(str(timezone("US/Pacific").localize(datetime(2015, 1, 31, 12
print(str(timezone("US/Pacific").localize(datetime(2015, 7, 31, 12

$ python temp2.py
2015-01-31 12:00:00-08:00
2015-07-31 12:00:00-08:00 <- wrong
2015-01-31 12:00:00-08:00
2015-07-31 12:00:00-07:00 <- right
$

Good luck!

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Rick Johnson wrote:

> On Tuesday, March 15, 2016 at 5:54:46 PM UTC-5, Thomas 'PointedEars' Lahn
> wrote:
>> Vinicius Mesel wrote:
>> > I'm a 16 year old Python Programmer that wanted to do
>> > something different. But, like we know, ideas are quite
>> > difficult to find. So I decided to develop a URL
>> > Shortener to help the Python community out and share my
>> > coding knowledge, and today the project was launched
>> > with its first stable version.
> 
> Although Thomas makes some very valid points, don't let
> anybody discourage you Vinicius. If you want to build
> something, and everyone in the *ENTIRE* world say's it's a bad
> idea, do it anyway -- if for nothing else than to spite
> them. :-P

You are giving bad advice to a junior developer, advising them to *waste* 
*their* *youth* developing for the recycle bin.  It can no doubt be 
educational to play with programming.  But if actually the *entire* world 
says a it is a bad idea, then it probably is.  Unfortunately, there is 
prevailing the common misconception of the misunderstood genius, and that a 
real genius would sink so low as to do things just in order to prove 
everybody wrong.  But to do so is not genial, it is outright stupid.  
Because what if it does not work out in the end?

Instead, they should find out what problems people have, and what kind of 
software people *really* and *desperately* *need* to solve them, and *then* 
go for it no matter what other people who are not in need say.  Often the 
people that desperately need something solved are close; in fact, it is very 
likely that the first person that really needs something solved is oneself.

For example, what really got me into programming was that I was tired of 
typing commands to run my favorite DOS games, so I learned batch file 
programming to write myself a menu to start them if they were in the paths 
where I expected them to be.  Being limited by the shortcomings of that 
language, I learned Turbo Pascal to search for the games, and in doing that 
I learned a lot of other things that I had never thought of before (like 
creating GUIs, and mouse pointers with embedded Assembler code, and OOP).  
And so on, eventually to Python (IIRC, the second-last programming language 
that I learned).

Want a more prominent example?  Linus Torvalds wrote a kernel for an 
operating system because, although it started his fascination for operating 
systems, MINIX did not suffice for *him*; only later he announced *on 
Usenet* (comp.os.minix) what would become the Linux kernel, and look what 
arose from that.  Because the people he announced it to thought, “Hey, that 
could be really *useful*!”.
 
-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik

Hi Chris,

On 15/03/16 23:48, Chris Angelico wrote:

I agree, it's a risk. Any indirection adds that. So the benefit has to
be weighed against this inherent cost.


True, so it's not URL shorteners that I disagree with on principle, it's 
the _inappropriate_ use of URL shorteners ;) If one uses them on fora 
such as this which could be expected to exist for some considerable time 
then it's an issue. Elsewhere, then yes, the linking service may not 
last as long as the shortening service ...



 I often like to make a small
change when I reimplement, though - something that I thought was
ill-designed in the original,


OK, so maybe the idea for Vinicius (if he's still reading) to pursue is 
that it should be something that can be used as the basis for a URL 
shortening "service" that is distributed and can NOT go away (think 
DNS). That is what some people don't like about the URL shorteners, so 
maybe that's an itch that he might want to scratch.


I've no idea if other such projects already exist, it just occurred to 
me when responding.


E.
--
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 11:31 AM, Erik  wrote:
>
>>  I often like to make a small
>> change when I reimplement, though - something that I thought was
>> ill-designed in the original,
>
>
> OK, so maybe the idea for Vinicius (if he's still reading) to pursue is that
> it should be something that can be used as the basis for a URL shortening
> "service" that is distributed and can NOT go away (think DNS). That is what
> some people don't like about the URL shorteners, so maybe that's an itch
> that he might want to scratch.
>
> I've no idea if other such projects already exist, it just occurred to me
> when responding.

Now THAT is an interesting idea. I don't know how it would be handled,
though; since there has to be additional information that isn't in the
URL, and has to *not* be on any server that can go down, it basically
has to be a distributed thing somehow. So you'd need to look into how
things like Bitcoin work. It'd be pretty cool if it could work!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Encapsulation in Python

2016-03-15 Thread BartC

On 15/03/2016 21:02, Christian Gollwitzer wrote:

Am 14.03.16 um 23:40 schrieb BartC:

On 14/03/2016 22:20, Mark Lawrence wrote:
 > The RUE kept stating that he was an expert in unicode, but never once
 > provided a single shred of evidence to support his claim.  Until I see
 > substantiated evidence from you I am going to state quite cleary that
 > you've no idea, you're just another RUE.

Sorry, I'm not going to do that, and I don't expect anyone here to have
to do so either. You will have to take my posts as they are.


I don't think that you make things up, your posts are much too detailed
and plausible to be made up. Nevertheless, why don't you setup a
repository on an open source server, say github, and post your language
implementation there? Actually I would try it out to see how it compares
to other dynamic languages, especially since you do not use JIT
compilation to native code, but still claim that you get good
performance. You will also profit (in the form of bug reports) if
somebody actually tries your code.


OK, I'll see what I can do. In the meantime I've put together some notes 
about how my system works, and you can probably see that it's not so 
easy! (Because I use custom languages with circular dependencies...)


But there's some info there that may or may not be of interest:

http://pastebin.com/MsGLsC23

(And I assume everyone here uses Linux? That's another minor problem...)

--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote:

> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn
>  wrote:
>> Chris Angelico wrote:
>>> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
>>>  wrote:
 […] I cannot be sure because I have not thought this through, but with
>> ^^^
 aliases for common second-level domains, and with text compression, it
 should be possible to do this without a database.
>>>
>>> How? If you shorten URLs, you have to be able to reconstruct the long
>>> ones. Compression can't do that to arbitrary lengths. Somewhere there
>>> needs to be the rest of the information.
>>
>> First of all, you quoted me out of context.
> 
> I trimmed the context. You got a problem with that?

Please do not insult my intelligence.  I have a problem with that you are 
not marking the omission of considerable parts of *my* text, here giving the 
wrong impression that I did not start my follow-up in an encouraging way.
 
>> Second, do you even read what you reply to?  See the markings above.
> 
> Instead of thinking about URL shorteners specifically, think generally
> about information theory. You cannot, fundamentally, shorten all URLs
> arbitrarily. There just isn't enough room to store the information.

You are the one introducing “arbitrary” here.  I am not at all convinced, 
but this discussion is beyond the scope of this newsgroup/mailing list.
 
>> But speaking of length limits, the lines in your postings are too long,
>> according to Usenet convention.  I had to correct the quotations so that
>> they remained readable when word-wrapped.
> 
> Oh, so you'd rather the lines be cut to... I dunno, 80 characters?

No, quotations ought to be word-wrapped, preserving paragraphs, in order not 
to exceed that limit.  That is why the recommended line length limit for 
posting is not 80 characters, but something from 68 to 78.

> Might be a good reason to use a URL shortener.

URIs can posted to a newsgroup/mailing list without shortening them, by 
wrapping them without breaking them.  Will you *please* read [2] to clarify 
that misconception of yours?
 
-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Descriptors vs Property

2016-03-15 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote:

> Please ignore 'PointedEars',

Please ignore Mark Lawrence unless he has something on-topic to say.

How does that feel, Mark?

> every month or so for some weird reason

The reason being obviously that the people to whose postings I happen to 
post a follow-up to do not post using their real names.  It has nothing at 
all to do with timing.

> he complains about people not using their real names.  Why?  I've no idea,

I have told you already, but you did not listen.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread BartC

On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote:


Thanks for the informative post.  I've read it and disagree with the rational, 
it places Python in a decided minority of the major languages.


And this proposal (3103) was by the guy who invented the language!

Good thing he didn't have design-by-committee when he was putting it 
together.


--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread Mark Lawrence

On 16/03/2016 00:51, BartC wrote:

On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote:


Thanks for the informative post.  I've read it and disagree with the
rational, it places Python in a decided minority of the major languages.


And this proposal (3103) was by the guy who invented the language!

Good thing he didn't have design-by-committee when he was putting it
together.



Did you miss or deliberately ignore my earlier:-


The "Rejection Notice" section of the former states "A quick poll during 
my keynote presentation at PyCon 2007 shows this proposal has no popular 
support. I therefore reject it.".



What do you not understand about "has no popular support", and this at 
the big Python annual event that is attended by numerous Python 
developers, including core developers, from all around the world?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Case Statements

2016-03-15 Thread jj0gen0info
You have apparently mistaken me for someone who's worried.  I don't use Python, 
I was just curious as to why a construct that is found, not only to be useful 
in 95% of other languages, but is generally considered more flexible and 
readable than the if-elif, was missing in Python.  (your link "Switch Statement 
Code Smell" not withstanding)

Have a great day :)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Gene Heskett
On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote:

> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn
>
>  wrote:
> > Chris Angelico wrote:
> >> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
> >>
> >>  wrote:
> >>> […] I cannot be sure because I have not thought this through, but
> >>> with
> >
> > ^^^
> >
> >>> aliases for common second-level domains, and with text
> >>> compression, it should be possible to do this without a database.
> >>
> >> How? If you shorten URLs, you have to be able to reconstruct the
> >> long ones. Compression can't do that to arbitrary lengths.
> >> Somewhere there needs to be the rest of the information.
> >
> > First of all, you quoted me out of context.
>
> I trimmed the context. You got a problem with that?
>
> > Second, do you even read what you reply to?  See the markings above.
>
> Instead of thinking about URL shorteners specifically, think generally
> about information theory. You cannot, fundamentally, shorten all URLs
> arbitrarily. There just isn't enough room to store the information.
>
> > And as for second-level domains, consider for example “t.c” instead
> > of “twitter.com” as part of the short URI.
>
> That'll work only for the ones that you code in specifically, and
> that's only shortening your URL by 8 characters. A typical URL needing
> shortening is over 80 characters - maybe several hundred. You need to
> cut that down to a manageable length. That fundamentally cannot be
> reversed without readding information.

And I submit that putting someone in charge of the drives organization, 
and the database on that drive that the url has to dig thru, can make a 
huge difference in the length of the resultant url.

> >>> And with the exception of Twitter-ish sites that place a limit on
> >>> message length, there really is *no need* for shorter URIs
> >>> nowadays.  (HTTP) clients and servers are capable of processing
> >>> really long ones [1]; electronic communications media and related
> >>> software, too [2].  And data storage space as well as data
> >>> transmission has become exceptionally inexpensive.  A few less
> >>> bytes there do not count.

They may not count for that much in terms of what the user pays for 
bandwidth, but see below.  And some users are probably still paying for 
their internet access by the minute in some locales.

> >> There are many places where there are limits (hard or soft) on
> >> message lengths. Some of us still use MUDs and 80-character line
> >> limits.
> >
> > See above.  Covered by [2].
>
> Unrelated. Not covered by that link. Go use a MUD some time.
>
> > But speaking of length limits, the lines in your postings are too
> > long, according to Usenet convention.  I had to correct the
> > quotations so that they remained readable when word-wrapped.
>
> Oh, so you'd rather the lines be cut to... I dunno, 80 characters?
> Might be a good reason to use a URL shortener.
>
usenet generally encourages us to set our word wrap at 72 to 73 
characters so there is room for the invitable additions of the quote > 
character so we can track who said what.  That is just common good 
practice.

> >> Business cards or other printed media need to be transcribed by
> >> hand. Dictation of URLs becomes virtually impossible when they're
> >> arbitrarily long.

OTOH, url's in excess of 250 characters long exist only to polish ego's 
of the people involved or demonstrate that they could not organize a 
company picnic in a 4 person company.

Few enough recognize that problem and post their urls on the form of 
 which most email agents recognize as a url, that before 
presentation to a browser when you click on it, will then go thru it, 
stripping out the line feeds and carriage returns so that the original 
as pasted and wrecked by the emailers word wrapping, is restored and it 
has at least a snowballs chance in hell of working.

But you can't teach a winderz user to do that any better than you can 
break them from top posting.

> > (You are not reading at all, are you?)  This is covered by that:
> >>> Instead, there *is* a need for *concise*, *semantic* URIs that Web
> >>> (service) users can *easily* *remember*.  It is the duty of the
> >>> original Web authors∕developers to make sure that there are, and I
> >>> think that no kind of automation is going to ease or replace
> >>> thoughtful path design anytime soon (but please, prove me wrong):
> >>
> >> Sure.. if you control the destination server. What if you're
> >> engaging in scholarly discussion about someone else's content? You
> >> can't change the canonical URLs, and you can't simply copy their
> >> content to your own server (either for licensing reasons or to
> >> guarantee that the official version hasn't been tampered with).
> >
> > That is why I said it is the duty of the original
> > authors/developers.  It is a community effort, and it is not going
> > to happen overnight.  But evading

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Gene Heskett wrote:

> On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote:
>> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn
>> > And as for second-level domains, consider for example “t.c” instead
>> > of “twitter.com” as part of the short URI.
>> That'll work only for the ones that you code in specifically, and
>> that's only shortening your URL by 8 characters. A typical URL needing
>> shortening is over 80 characters - maybe several hundred. You need to
>> cut that down to a manageable length. That fundamentally cannot be
>> reversed without readding information.
> 
> And I submit that putting someone in charge of the drives organization,
> and the database on that drive that the url has to dig thru, can make a
> huge difference in the length of the resultant url.

Maybe it’s just the late/early hour, but you’ve just lost me.
Please elaborate.
 
>> >>> And with the exception of Twitter-ish sites that place a limit on
>> >>> message length, there really is *no need* for shorter URIs
>> >>> nowadays.  (HTTP) clients and servers are capable of processing
>> >>> really long ones [1]; electronic communications media and related
>> >>> software, too [2].  And data storage space as well as data
>> >>> transmission has become exceptionally inexpensive.  A few less
>> >>> bytes there do not count.
> 
> They may not count for that much in terms of what the user pays for
> bandwidth, but see below.  And some users are probably still paying for
> their internet access by the minute in some locales.

So they should loathe more the overhead measured in *kibibytes* and delay 
measured in *seconds* caused by additional HTTP requests due to redirection 
from “short URLs” than the few more *bytes* in longer, original URLs, yes?
 
-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 11:05:32 PM UTC+5:30, Peter Otten wrote:
> Indeed. It's still better than
> 
> "This is %s a fruit" % (x in x_list and "" or "not")
> 
> The bug is intentional; the fix is of course
> 
> "This is %s a fruit" % (x in x_list and "most likely" or "probably not")
> 
> ;)

Thanks
I wondered what/why you were bringing in this clunky, error-prone
pre-conditional meme...
And came across 
https://mail.python.org/pipermail/python-dev/2005-September/056510.html

| I propose that in Py3.0, the "and" and "or" operators be simplified to
| always return a Boolean value instead of returning the last evaluated
| argument.

Good to know that Raymond Hettinger disagrees with Guido on the
messed-up, ½-class status of bools in python
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Gene Heskett
On Tuesday 15 March 2016 22:46:44 Thomas 'PointedEars' Lahn wrote:

> Gene Heskett wrote:
> > On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote:
> >> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn
> >>
> >> > And as for second-level domains, consider for example “t.c”
> >> > instead of “twitter.com” as part of the short URI.
> >>
> >> That'll work only for the ones that you code in specifically, and
> >> that's only shortening your URL by 8 characters. A typical URL
> >> needing shortening is over 80 characters - maybe several hundred.
> >> You need to cut that down to a manageable length. That
> >> fundamentally cannot be reversed without readding information.
> >
> > And I submit that putting someone in charge of the drives
> > organization, and the database on that drive that the url has to dig
> > thru, can make a huge difference in the length of the resultant url.
>
> Maybe it’s just the late/early hour, but you’ve just lost me.
> Please elaborate.
>
Elaborate? Unless the database is expected to handle the whole human 
race, what 9 billion of us?, a subdir name longer than 8 chars is wasted 
space.  And we regularly see them much longer that that, with a friggin 
regex in the middle, using 6 to 15 subdirs if what I read is broken 
down. Thats assinine IMO, and if because they cannot do it right for a 
platform other than windows, it doesn't work for me, then I don't care 
if it links to the g-code (RS-274-D) that would make my machines carve 
me a key to Fort Knox.  If these ID10T's want me to see whatever the 
heck it is they're are peddling to make me last all night, they WILL fix 
it.  Heck, at 81, and diabetic for almost 30 years, nothing they can 
sell me will fix it anyway. :(
> >> >>> And with the exception of Twitter-ish sites that place a limit
> >> >>> on message length, there really is *no need* for shorter URIs
> >> >>> nowadays.  (HTTP) clients and servers are capable of processing
> >> >>> really long ones [1]; electronic communications media and
> >> >>> related software, too [2].  And data storage space as well as
> >> >>> data transmission has become exceptionally inexpensive.  A few
> >> >>> less bytes there do not count.
> >
> > They may not count for that much in terms of what the user pays for
> > bandwidth, but see below.  And some users are probably still paying
> > for their internet access by the minute in some locales.
>
> So they should loathe more the overhead measured in *kibibytes* and
> delay measured in *seconds* caused by additional HTTP requests due to
> redirection from “short URLs” than the few more *bytes* in longer,
> original URLs, yes?
>
> --
> PointedEars
>
> Twitter: @PointedEars2
> Please do not cc me. / Bitte keine Kopien per E-Mail.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 7:23:12 PM UTC-5, Thomas 'PointedEars' Lahn wrote:

(Note: i had to rearrange your paragraph to accommodate a more
intuitive response. I apologize for this, but i'm confident
i was able to maintain your original intent)

> You are giving bad advice to a junior developer, advising
> them to *waste* *their* *youth* developing for the recycle
> bin. Because what if it does not work out in the end?

But what if it does "work out"? There is only one way to
find out, yes?

> It can no doubt be educational to play with programming.
> But if actually the *entire* world says it [...] is a bad
> idea, then it probably is. Unfortunately, there is [...]
> the common misconception of the misunderstood genius, and
> that a real genius would sink so low as to do things just
> in order to prove everybody wrong. But to do so is not
> genial, it is outright stupid.

I completely disagree.

Even if the fruits of your labor end up in the recycle bin,
so what! There is always a valuable lesson to be learned
from every project, even if that lesson is: " Hmm, this was
a very bad idea, i should have considered the consequences
of this vector path more carefully".

But in many cases, one cannot foresee the failure, and must
travel *DEEP* into the investigatory process before the
failure becomes apparent. And just because one cannot solve
a specific problem, one would be foolish to conclude that
the problem has no attainable solution. One should simply
conclude, that they lack the intelligence to solve the
problem.

The worst attitude you can adopt is that of the pessimist,
who is defeated by his own "fear of failure" before he even
begins. None of us are Omniscient, therefore, we must realize
that in order to achieve any level of intelligence *GREATER*
than what we currently posses, we must be unafraid to reach
beyond our intellectual limits and into the "scary dark
corners" of the "unknown".

Yes, failure is highly likely in these "dark areas", and we
could be bitten by a spider lurking in the shadows, but
until we systematically map these unfamiliar areas, even if
necessary, with *BRUTE FORCE TRIAL AND ERROR*, we will never
attain a greater level of intelligence.

And perhaps some people don't want to venture "outside their
comfy little box". That's fine. But their defeatism will
never discourage me from actively expanding my "intellectual
horizons". Boxes are confining, intellectual or otherwise,
and i was born to be free!

The best method of achieving intellectual greatness, is to
take on projects/challenges that are well outside your
comfort zone. Don't worry, if you have a properly
functioning brain, then you already possess the *ONLY* tool
you will ever need to accomplish the mission.

The main reason i hang out here, answering questions, is not
so much to help others, but to learn. Learning is my primary
goal, and helping is my secondary. I have found that simply
"reading the archives" is not enough, because it is not
*READING* that motivates me to learn, no, it is the
potential of failure that motivates me put-in the extra
effort to ensure that my advice is good advice. And sure,
i've failed quite a few times, but do those failures bother
me? NO WAY! Because each time i failed, i made sure to
investigate and discover *WHY* i failed. I learned, and i
became more intelligent each time.

The same "motivational force" can be utilized when we post
our source code publicly. Every one of us, has source code
hiding in our repos that we would be ashamed to show
publicly (yes, don't lie!). Perhaps the code is not using
proper Pythonic style convention, perhaps it is missing
documentation strings, or perhaps, it is just some really
horrific algorithms that we have been too lazy to re-write.
Posting the code presents us with a high probability that
someone may find these "warts", and expose them. For that
reason, we will be motivated to repair these warts before
making them public.

So my point is: Don't be fearful of publicly posting your
code, or participating in online help groups, or, more
generally, stepping outside of your "intellectual comfort
zone" by taking on a challenging project. Because if you're
not failing on a regular basis , then that should be
*GLARING* indication that you're not pushing your boundaries
far enough.

"FAILURE IS A NATURAL BYPRODUCT OF THE LEARNING PROCESS" -- rr

> Want a more prominent example?  Linus Torvalds wrote a
> kernel for an operating system because, although it
> started his fascination for operating systems, MINIX did
> not suffice for *him*; only later he announced *on Usenet*
> (comp.os.minix) what would become the Linux kernel, and
> look what arose from that.  Because the people he
> announced it to thought, "Hey, that could be really
> *useful*!".

I too have dreamed of writing an OS, if for nothing more,
than to prove to myself i can do it. Because i know i can. A
few years back, i started hacking at the Python2.x source,
attempting to mold it into my o

Re: Case Statements

2016-03-15 Thread Mario R. Osorio
On Tuesday, March 15, 2016 at 9:55:27 PM UTC-4, jj0ge...@gmail.com wrote:
> You have apparently mistaken me for someone who's worried.  I don't use 
> Python, I was just curious as to why a construct that is found, not only to 
> be useful in 95% of other languages, but is generally considered more 
> flexible and readable than the if-elif, was missing in Python.  (your link 
> "Switch Statement Code Smell" not withstanding)
> 
> Have a great day :)

Switch and case statements are such a waste of time that, in order to 
understand them you have to mentally use if/elseif/else/endif statements. 
Furthermore, the concepts of switch and case could not even exist without the 
notion of if/elseif/else/endif statements. Why then, add an extra level of 
complication??.

Go play with Java or Maybe C++. Have fun with their fancy if/elseif/else/endif 
statements oops, sorry, they call them switch and/or case statements.

Wish you the best and please lete us know if and when you have a deep fall 
through a breakeless case ... You must love debugging those ... they are fun, 
specially a 4:30am, with an hour and a half to deploy...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Case Statements

2016-03-15 Thread Mark Lawrence

On 16/03/2016 01:55, jj0gen0i...@gmail.com wrote:

You have apparently mistaken me for someone who's worried.  I don't use Python, I was 
just curious as to why a construct that is found, not only to be useful in 95% of other 
languages, but is generally considered more flexible and readable than the if-elif, was 
missing in Python.  (your link "Switch Statement Code Smell" not withstanding)

Have a great day :)



So you would rather write something like:-

switch (x):
  case COW:
moo()
break

  case DUCK:
quack()
break

  default IDUNNO:
panic()

than:-

x.makeNoise()

?

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: WP-A: A New URL Shortener

2016-03-15 Thread Gregory Ewing

Chris Angelico wrote:

There are many places where there are limits (hard or soft) on message
lengths. Some of us still use MUDs and 80-character line limits.
Business cards or other printed media need to be transcribed by hand.
Dictation of URLs becomes virtually impossible when they're
arbitrarily long.


Your typical shortened URL made up of a random jumble
of letters and numbers isn't good for dictating or
transcribing from a business card either.

For those uses, a well-chosen semantically-memorable
URL is still the best solution. There shouldn't be
too much trouble in arranging one of those that's
short enough to put on a business card.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 3:27 PM, Gregory Ewing
 wrote:
> Chris Angelico wrote:
>>
>> There are many places where there are limits (hard or soft) on message
>> lengths. Some of us still use MUDs and 80-character line limits.
>> Business cards or other printed media need to be transcribed by hand.
>> Dictation of URLs becomes virtually impossible when they're
>> arbitrarily long.
>
>
> Your typical shortened URL made up of a random jumble
> of letters and numbers isn't good for dictating or
> transcribing from a business card either.
>
> For those uses, a well-chosen semantically-memorable
> URL is still the best solution. There shouldn't be
> too much trouble in arranging one of those that's
> short enough to put on a business card.

Quite a few URL shorteners allow you to pick a keyword (conditionally
on it not being in use, of course). For example,
http://bit.ly/threshvote is perfectly memorable, but is still shorter
than the address it redirects to. Given that it's a mobile app
download link, it's extremely helpful for people to be able to type
that without clicking on it; and since it's going to the Google Play
Store, the creator of the app has no power to shorten the official
URL.

In some cases, the correct solution would be a short URL at a domain
that the provider controls. But that's no different from running your
own shortener service - it still has the extra indirection and
consequent risks. So for a lot of people, a public shortener is just
as good.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: WP-A: A New URL Shortener

2016-03-15 Thread Steven D'Aprano
On Wednesday 16 March 2016 10:38, Thomas 'PointedEars' Lahn wrote:

> Chris Angelico wrote:
> 
>> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn
>>  wrote:
> 
> Attribution *line*, not attribution novel.

Chris' attribution is about 75,000 words short of even a small novel.

And it would comfortably fit on a single line if not for your insistence on 
using a non-real (pretend) name:

"On Wed, Mar 16, 2016 at 9:53 AM, Thomas Lahn  wrote:"

Given how often you tell people off for not using "real names", I don't 
understand why you do the same thing.



-- 
Steve

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