Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93868 > unrolled thread

Noob in Python. Problem with fairly simple test case

Started by"Jason P." <suscricions@gmail.com>
First post2015-07-15 04:44 -0700
Last post2015-07-22 03:48 +1000
Articles 17 on this page of 37 — 12 participants

Back to article view | Back to comp.lang.python


Contents

  Noob in Python. Problem with fairly simple test case "Jason P." <suscricions@gmail.com> - 2015-07-15 04:44 -0700
    Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-15 22:11 +1000
      Re: Noob in Python. Problem with fairly simple test case Larry Hudson <orgnut@yahoo.com> - 2015-07-15 20:01 -0700
        Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-16 13:11 +1000
          Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-15 20:33 -0700
            Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-16 13:44 +1000
              Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 13:03 -0700
                Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-17 06:11 +1000
                  Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 13:30 -0700
                    Re: Noob in Python. Problem with fairly simple test case Emile van Sebille <emile@fenx.com> - 2015-07-16 14:27 -0700
                    Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-17 09:24 +1000
                      Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 17:30 -0700
                        Re: Noob in Python. Problem with fairly simple test case Steven D'Aprano <steve@pearwood.info> - 2015-07-17 12:44 +1000
                          Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-17 13:01 +1000
                            Re: Noob in Python. Problem with fairly simple test case Steven D'Aprano <steve@pearwood.info> - 2015-07-17 16:47 +1000
                              Re: Noob in Python. Problem with fairly simple test case wxjmfauth@gmail.com - 2015-07-17 02:15 -0700
                              Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-17 20:57 +1000
                          Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 21:15 -0700
                            Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-17 15:16 +1000
                            Re: Noob in Python. Problem with fairly simple test case Steven D'Aprano <steve@pearwood.info> - 2015-07-17 16:38 +1000
                              Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-17 10:57 -0700
                                Re: Noob in Python. Problem with fairly simple test case Laura Creighton <lac@openend.se> - 2015-07-17 22:38 +0200
                                  Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-18 14:12 -0700
                                Re: Noob in Python. Problem with fairly simple test case Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-17 23:03 +0100
                            Re: Noob in Python. Problem with fairly simple test case Terry Reedy <tjreedy@udel.edu> - 2015-07-17 18:45 -0400
                              Re: Noob in Python. Problem with fairly simple test case wxjmfauth@gmail.com - 2015-07-18 00:30 -0700
                              Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-18 16:18 -0700
                                Re: Noob in Python. Problem with fairly simple test case Laura Creighton <lac@openend.se> - 2015-07-19 11:09 +0200
                                  Re: Noob in Python. Problem with fairly simple test case Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-19 10:25 -0700
                                    Re: Noob in Python. Problem with fairly simple test case MRAB <python@mrabarnett.plus.com> - 2015-07-19 18:45 +0100
                                    Re: Noob in Python. Problem with fairly simple test case Laura Creighton <lac@openend.se> - 2015-07-19 19:50 +0200
                                    Off-topic: Europe [was Re: Noob in Python. Problem with fairly simple test case] Steven D'Aprano <steve@pearwood.info> - 2015-07-20 12:30 +1000
                            Re: Noob in Python. Problem with fairly simple test case Emile van Sebille <emile@fenx.com> - 2015-07-17 16:15 -0700
                          Re: Noob in Python. Problem with fairly simple test case Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-07-17 08:26 -0400
          Re: Noob in Python. Problem with fairly simple test case Larry Hudson <orgnut@yahoo.com> - 2015-07-16 20:49 -0700
      Re: Noob in Python. Problem with fairly simple test case "Jason P." <suscricions@gmail.com> - 2015-07-21 10:38 -0700
        Re: Noob in Python. Problem with fairly simple test case Chris Angelico <rosuav@gmail.com> - 2015-07-22 03:48 +1000

Page 2 of 2 — ← Prev page 1 [2]


#94020

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2015-07-17 10:57 -0700
Message-ID<5de5b26b-8a4a-4ca0-9713-a9e85ef46a62@googlegroups.com>
In reply to#93993
On Friday, July 17, 2015 at 1:38:52 AM UTC-5, Steven D'Aprano wrote:
> 75% or 90% is not a "vast majority". Vast majority implies more than 99%.
> 
> But regardless of the precise meaning of "vast", if you want to dismiss one
> in four people (25%) or one in ten (10%) as inconsequential, then you've
> got some serious issues.

My estimate was *CONSERVATIVE* Steven. Read my words:
"EDUCATED GUESS". Unlike you, I'm not going to falsify the
numbers just to win an argument. I feel very strongly about
the 75%, even though i know the percentage is much higher.

> You can't "risk" the upgrade? What precisely are you afraid of?

Simple. I don't want to waste even a second of time
debugging old code that has been bug free for years. I would
rather spend that time writing new code. Productivity is
important to "some" of us Steven!

And don't drag out that old cliche about how running 2to3 is
the path to lands of "milk and honey". I call BS! With the
nonrestrictive typing of Python a bug can be hidden from even
the best testing methodology. Why would i risk exception hell
just to please you? I don't make my decisions based on your,
or the BDFL's, opinions of what is best for me. Heck, i
don't make my decisions based on what "might" be good for
the Python community. MY CODE! My RULES! GOT IT?

> That's nonsense. Spinning tires implies no forward motion.
> Python 3 usage is *certainly* moving forward: we've gone
> from the situation in 2008 of nobody using it, to the
> current situation where there's lots of activity around
> it:

How much of that is purely hype? Remember the explosion of
Python usage *BEFORE* Python3? However, there
has been a steady decline of Python usage since.

> students learning on Python 3, 

You act as if *EVERY* student that ever uses Python will
continue using Python forever, and *ONLY* Python! When in
fact, Python is mostly a stepping stone for CS-101 students
on their path to real languages like C, Java, DHTML, and the
APIs of the various mobile platforms. *THIS* is where code is
written to solve real life problems. *THIS* is where code
directly interacts with the *VAST MAJORITY* (yeah i said it!)
of humans on this planet to get stuff done! But where's Python? 

Oh, i know, it's stuck on my desktop. @_@

PYTHON IS A ONE TRICK PONY!

> My guess is, the rate of Python 3 adoption is going to hit
> the tipping point in 2 or 3 years, after which time it
> will be *very* rapid.

THE INTERNET WILL REMEMBER YOUR PREDICTION!

A lot can happen in 2-3 years that may render Python
obsolete (and your blabbing about 2020, really?).  My
prediction is that Python will never recover from this
backward compatibility issue. And sadly, Python2 had been
gaining stong momentum before Python3 arrived.

The code break was the first blow, and the evolving
technologies will be the final blow. Desktops computers are
becoming obsolete, and mobile platforms are the future. This
train has long since departed the station.

[toc] | [prev] | [next] | [standalone]


#94031

FromLaura Creighton <lac@openend.se>
Date2015-07-17 22:38 +0200
Message-ID<mailman.659.1437165529.3674.python-list@python.org>
In reply to#94020
I think kivy is doing a very nice job of python-on-the-mobile.
Have you looked?  Please do not rant at me, just tell me what you
think.

Laura

[toc] | [prev] | [next] | [standalone]


#94061

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2015-07-18 14:12 -0700
Message-ID<7e73baa6-cdaa-484e-98e3-1f7156b26d24@googlegroups.com>
In reply to#94031
On Friday, July 17, 2015 at 3:39:02 PM UTC-5, Laura Creighton wrote:
> I think kivy is doing a very nice job of python-on-the-mobile.
> Have you looked?  Please do not rant at me, just tell me what you
> think.

Hello Laura,

I'm not sure if you're replying to me (as there is no quoted
context) but since you mentioned "rant" i "suppose" that you 
could be referring be me? I mean, i don't know what gave you 
the impression that i would rant at anyone? But don't worry 
dear, i've always self-censored my rants when females are 
listening -- oops, gonna get some flac for that comment! O:-)

First off. I don't remember seeing you here before. So allow 
me to say that having a female presence in this group is quite
refreshing. I hope you continue to participate!

Also, I have a lot to say on this subject, and most of what
i say below is intended as a "general response", so please 
don't take any of my words as a personal attack. Thanks.

============================================================
 Regarding Kivy
============================================================

I was not aware of this project until you mentioned it.
However, i'm skeptical because: (1) it will suffer from 
latency issues, especially on the mobile platforms, and (2) 
but even if not, i feel projects like this are only 
encouraging the stagnation of our evolution towards 
multi-device compatibility.

============================================================
 The road to enlightenment is paved with introspection
============================================================

For the last few decades we have been consumed with the task
of bringing multi-platform-ism to every language or API or
software or whatever. And this was a noble pursuit indeed!

HOWEVER,

We are now moving into a new age. Not of cross-platform-ism
(where we want to write code *ONCE* and have it run on
Linux, Windows, and Mac) but were we want to write code
*ONCE* and have it run on a desktop, or a notebook, or a
phone, or a watch, or a refrigerator, or even a HUD in our 
spaceship!

I believe it's high time that we move away from religious
ideologies codified in "selfish syntaxes" and "selfish
interfaces". 

Because, we seek out these segregating policies just so we 
can say "hey, we're different", when in reality, we're
all the same underneath.

For example: printing to stdout is printing to stdout -> no
matter what syntax you choose to use. Likewise, iterating
over a collection of items, or creating an object that
implements the OOP paradigm, or writing a stream into a
storage medium -> the fundamentals of these concepts do not
change simply by plastering them with selfish identities.
Neither is the concept of a GUI window any different if that
window was created in Windows, Linux, or Mac.

I could provide example after example (ad nauseum) of how
we're creating these selfish syntaxes and selfish
interface, but i think you get the point.

This "need to fulfill" the underlying selfish desires that
we, as humans harbor, is preventing us (as programmers,
software engineers, hardware producers, and most importantly
-> end users) from reaching computing Nirvana. No programmer
should ever need to re-write the same code numerous times so
that it can run on multiple devices.  We, are injecting
needless superfluity into this system. And for no more
reason than our need to fulfill selfish desires!

Why are we *NOT* working together to create a single, linear,
and scaleable system of producing software, A system that
compiles all the best ideas, and throws the remainder into
the refuse bin of history.

The only system i've seen that has made *ANY* attempt  (as
feeble as it may be) is DHTML. But even with it's modern
look and feel, it lacks the necessary hooks into the diverse
platforms to get any "real work" done. However, utilizing
the Trojan horse of "browser ubiquity", and expanding on it,
may be much less work than rebuilding the entire system from
the ground up (something to ponder...)

Most of what we're doing, in the programming language design
field, is fighting over who's version of "superficial CSS"
is going to be the official version. Our partisan efforts
are merely adolescent accessorizing. But we lack the
introspective ability to notice the vanity and futility of 
our efforts.

If you want to know why i rant so much, it's because i'm
both saddened and angry that we waste our time on these
petty battles. When, in fact, we could achieve greatness by
working towards a common goal.

============================================================
 Utopia's eventually fail Rick!
============================================================

I'm aware of that! I'm aware that "conflict" is the
invisible force that breathes life into the cogs of
evolution. But your superficial understanding of my proposal
is not a failure of my proposal. ON THE CONTRARY!

For example. We can *ALL* remember how every cell phone
manufacture had their own selfish implementation of a
charging port. Heck, every time you bought a new phone, you
would be forced to buy a corresponding charger. Did not
matter that your old changer was still working fine, or if
the power output was exactly the same. NOPE! If the port did
not match the plug, then you were screwed -- which means you
were screwed 99% of the time!

Heck, i have dozens of old chargers in my closet. Each one
either has a different plug, or a different power output. And 
landfills are seething with them.

Thankfully, at some point, most manufacturers switched to
micro USB (possibly from governmental regulation???) and the
charging routine of many cell phone users have been joyful
since. 

*NOW*, i can borrow a friends charger if my battery level
becomes low. *NOW*, i can buy a charger from *ANY*
manufacture. This is freedom. And this is how we remove
superfluously injected selfishness from our systems!

Which is the very point i'm trying to make about our multi-
device problem. We have willfully injected superfluity into
our system of software creation, and as a result, we are
wasting precious time fitting square blocks into round holes
when we would could spend that time solving newer, more
complex problems. Changing the world <-> instead of chewing
the cud!

I'm not sure if an authority will need to step in and
regulate this blatant and infantile selfishness, or if we,
as active members, and thus, guilty by association, will
take the necessary steps to move ourselves towards the
linear path to software engineering Nirvana.

A system that is designed from the ground up to produce the
best software, in the least amount of time. A system that
not only rewards creativity, productivity, and pragmatic
necessity, but a system that is designed to foster it; to
cradle it; to nurture it. That is my dream. And the status
quo is our collective nightmare!

[toc] | [prev] | [next] | [standalone]


#94036

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-17 23:03 +0100
Message-ID<mailman.664.1437170638.3674.python-list@python.org>
In reply to#94020
On 17/07/2015 21:38, Laura Creighton wrote:
> I think kivy is doing a very nice job of python-on-the-mobile.
> Have you looked?  Please do not rant at me, just tell me what you
> think.
>
> Laura
>

At least rr occasionally comes out with something useful, usually WRT 
tkinter.  He's in the bottom division when compared to the RUE, who is 
still managing to get onto gg with his complete nonsense.  I'll admit I 
enjoy tripping over there just to report him.

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

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#94038

FromTerry Reedy <tjreedy@udel.edu>
Date2015-07-17 18:45 -0400
Message-ID<mailman.665.1437173150.3674.python-list@python.org>
In reply to#93985
On 7/17/2015 12:15 AM, Rick Johnson wrote:
> On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote:
>> [...] My take from all this is that overall, Python 3
>> take-up is probably > around 10% of all Python users,
>
> All that rambling just to agree with me? My educated guess
> is a minimum of 75% still using Python2.x.

I would call that a strong majority.

> But i'll take your 90% because it makes my argument stronger! O:-D

Unlike Chris, I would see that as a 'vast majority'.

But these relative numbers are, as near as I can tell, restricted to the 
english-speaking world, perhaps extended to the latin-1 based world. 
Anyone who wants unicode identifiers must use Python 3 (or a translated 
Python like ChinesePython).  Anyone seriously working with Unicode will 
find 3.3+ more pleasant, if not required (especially on Windows).

On Amazon, the first hit for 'Japanese Python' is Dive into Python 3 
(Japanese edition).  As near as I can tell, there is no Japanese edition 
for the original Dive into Python (2).  As I remember, half the Python 
books I saw in Japan *3 years ago* were for Python 3.

Overall, I suspect that Python 3 penetration is greater in Asia.

Rick, I only care about porting of public libraries.  Leave your private 
code in Python 2.  Continue writing new code in Python 2 if you wish.  I 
only object to those who pressure others to not port to or writes in 
Python 3.

If you want to help 2.7 become better, we need people test and backport 
patches to 2.7. Since 2.x bugs me as much as 3.x seems to bug you, I am 
considering not backporting until someone volunteers to help.

Now my question for you or anyone else: If the vast majority of Python 
programmers are focused on 2.7, why are volunteers to help fix 2.7 bugs 
so scarce?  Does they all consider it perfect (or sufficient) as is? 
Should the core developers who do not personally use 2.7 stop 
backporting, because no one cares if they do?

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#94051

Fromwxjmfauth@gmail.com
Date2015-07-18 00:30 -0700
Message-ID<32f52bc6-986c-4932-82a3-29cda0b1466d@googlegroups.com>
In reply to#94038
Le samedi 18 juillet 2015 00:46:01 UTC+2, Terry Reedy a écrit :
> 
> But these relative numbers are, as near as I can tell, restricted to the 
> english-speaking world, perhaps extended to the latin-1 based world. 
> Anyone who wants unicode identifiers must use Python 3 (or a translated 
> Python like ChinesePython).  Anyone seriously working with Unicode will 
> find 3.3+ more pleasant, if not required (especially on Windows).
> 

In Unicode, there is no latin-1.

There are only people who do not understand Unicode, who
are attempting to create naively a "UCS1" coding scheme.

It is not with (eg.) CJK characters that Python fails.
It's with *latin* chars that Python particularly fails and
will always fails.

jmf

PS You can try to create a "UTF16+", this will not solve
and can not solve the problem. Remember: mathematics!

[toc] | [prev] | [next] | [standalone]


#94068

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2015-07-18 16:18 -0700
Message-ID<4760b41d-54c8-436f-a40b-40ecd9622c5b@googlegroups.com>
In reply to#94038
On Friday, July 17, 2015 at 5:46:01 PM UTC-5, Terry Reedy wrote:
> But these relative numbers are, as near as I can tell,
> restricted to the english-speaking world, perhaps extended
> to the latin-1 based world. Anyone who wants unicode
> identifiers must use Python 3 (or a translated Python like
> ChinesePython).  Anyone seriously working with Unicode
> will find 3.3+ more pleasant, if not required (especially
> on Windows).

I'll have to admit you make a good point here. Although the
argument is diminished by observing that Ruby is far more
popular in Asia than Python. Python seems to be mainly a
Scandinavian, European, and American toy. For the most part
anyway. There are always exceptions to any rule. I mean,
think about it: who besides Xah Lee has an Asian name here?
And it's been years since we've heard from him! O:-D

> On Amazon, the first hit for 'Japanese Python' is Dive
> into Python 3 (Japanese edition).  As near as I can tell,
> there is no Japanese edition for the original Dive into
> Python (2).  As I remember, half the Python books I saw in
> Japan *3 years ago* were for Python 3.
> 
> Overall, I suspect that Python 3 penetration is greater in
> Asia.

I would agree with that assessment, simply because of the
Unicode factor. But i don't believe it's a "large
audience". And don't get me wrong, i'm not wishing for the
numbers to go one way or another. I just simply want to find
the truth.

> Rick, I only care about porting of public libraries.
> Leave your private code in Python 2.  Continue writing new
> code in Python 2 if you wish.  I only object to those who
> pressure others to not port to or writes in Python 3.

I don't want to pressure anyone in either direction. We, as
the greater python community, did not vote to break
backwards compatibility, it was dropped on us like an Acme
anvil. But what we _can_ choose, is the version that suits
our needs best. I have chosen to remain with 2.x. I
encourage others to decide for themselves. I don't think
pushing 3.x is any less evil than pushing 2.x -- unless the
programmer is a python neophyte. In that case, go with 3.x.

> If you want to help 2.7 become better, we need people test
> and backport patches to 2.7. Since 2.x bugs me as much as
> 3.x seems to bug you, I am considering not backporting
> until someone volunteers to help.

What do you need help with? Can you be more specific? Of
course, a few people on this list are under the impression
that i cannot write Python code unless Tkinter is imported
first. I guess they think Tkinter is some sort of "magic
module" that endows it's importer with mad skills (such as
those i posses). Or, it could be that they're unwilling to
give me any credit. Who knows? I never did participate in
office politics anyway. I'm always too busy getting things
done!

> Now my question for you or anyone else: If the vast
> majority of Python programmers are focused on 2.7, why are
> volunteers to help fix 2.7 bugs so scarce?  Does they all
> consider it perfect (or sufficient) as is? Should the core
> developers who do not personally use 2.7 stop backporting,
> because no one cares if they do?

My guess is that most have become disenfranchised. Perhaps
some have moved to other languages. Perhaps some are
surviving on old code annuities and don't need to work
anymore. The number of programmers in this world is very
small, and Python programmers represent a very small subset
of _that_ small subset. Which means, small numerical losses
can result in extreme damage to the "intellectual fortitude"
of a community like ours. The days when the Python community
could spare a few minds is over, -- as we have entered an era
of Pythonic depression. Perhaps one day we'll look back on
these tough times and tell fabulously exaggerated stories of 
how rugged individualism, and a pinch of community spirit, 
freed the world from the dark clutches of evil.

  HISTORY IS DEFINED BY THE WINNERS

Let me know where i can be of assistance. It's always a
great pleasure to make utter fools of my rivals. >:-)

[toc] | [prev] | [next] | [standalone]


#94109

FromLaura Creighton <lac@openend.se>
Date2015-07-19 11:09 +0200
Message-ID<mailman.708.1437297500.3674.python-list@python.org>
In reply to#94068
In a message of Sat, 18 Jul 2015 16:18:57 -0700, Rick Johnson writes:
>I'll have to admit you make a good point here. Although the
>argument is diminished by observing that Ruby is far more
>popular in Asia than Python. Python seems to be mainly a
>Scandinavian, European, and American toy. For the most part
>anyway. There are always exceptions to any rule. I mean,
>think about it: who besides Xah Lee has an Asian name here?
>And it's been years since we've heard from him! O:-D

This is because this is an english-speaking mailing list, not
because people who don't speak English aren't using Python.  Being
here isn't much of an indicator.  And, despite Norway not being
part of the EU, Scandinavia is still in Europe.

Laura

[toc] | [prev] | [next] | [standalone]


#94136

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2015-07-19 10:25 -0700
Message-ID<ecfc43cc-1e5c-49ef-829e-d01112de4c96@googlegroups.com>
In reply to#94109
On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: 
> And, despite Norway not being part of the EU, Scandinavia
> is still in Europe.

This is a bit off topic: But i don't consider Scandinavia to
be a part of the EU. Not anymore than i would consider
America to be a part of the EU. Sure, we're all colloquially
known as "the west", but large ideological and social design
structures exist between the members. And besides, there is
a great possibility that the EU could implode on itself. 

Take for instance the disaster of Greece, with many other
large players teetering on the edge. The only ubiquitous
binding agent between all the member countries is the
existential need to conglomerate military power against foes
in the east. Beyond that, the union is superficial at best.
If the bailout fails, or another worldwide financial crisis
hits, the outcome could be disastrous for the EU. 

When those pension checks stop coming in the mail, people get
violent!

[toc] | [prev] | [next] | [standalone]


#94139

FromMRAB <python@mrabarnett.plus.com>
Date2015-07-19 18:45 +0100
Message-ID<mailman.729.1437327910.3674.python-list@python.org>
In reply to#94136
On 2015-07-19 18:25, Rick Johnson wrote:
> On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote:
>> And, despite Norway not being part of the EU, Scandinavia
>> is still in Europe.
>
> This is a bit off topic: But i don't consider Scandinavia to
> be a part of the EU. Not anymore than i would consider
> America to be a part of the EU. Sure, we're all colloquially
> known as "the west", but large ideological and social design
> structures exist between the members. And besides, there is
> a great possibility that the EU could implode on itself.
>
[snip]

Denmark and Sweden are _both_ members of the EU.

[toc] | [prev] | [next] | [standalone]


#94140

FromLaura Creighton <lac@openend.se>
Date2015-07-19 19:50 +0200
Message-ID<mailman.730.1437328244.3674.python-list@python.org>
In reply to#94136
In a message of Sun, 19 Jul 2015 10:25:35 -0700, Rick Johnson writes:
>On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: 
>> And, despite Norway not being part of the EU, Scandinavia
>> is still in Europe.
>
>This is a bit off topic: But i don't consider Scandinavia to
>be a part of the EU. Not anymore than i would consider
>America to be a part of the EU.

Well, that makes one of you. The significant number of people
who want to pull Sweden out of the EU still have a lot of work
ahead of them before ignoring laws that come from Brussels is
in my future.  But in or out of the EU, Sweden will still be in Europe.

Laura

[toc] | [prev] | [next] | [standalone]


#94190 — Off-topic: Europe [was Re: Noob in Python. Problem with fairly simple test case]

FromSteven D'Aprano <steve@pearwood.info>
Date2015-07-20 12:30 +1000
SubjectOff-topic: Europe [was Re: Noob in Python. Problem with fairly simple test case]
Message-ID<55ac5d2c$0$1662$c3e8da3$5496439d@news.astraweb.com>
In reply to#94136
On Mon, 20 Jul 2015 03:25 am, Rick Johnson wrote:

> On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote:
>> And, despite Norway not being part of the EU, Scandinavia
>> is still in Europe.
> 
> This is a bit off topic: But i don't consider Scandinavia to
> be a part of the EU. 

Laura didn't say that Scandinavia (Finland, Sweden, Norway, Denmark) is part
of the European Union (a political union), she explicitly stated that
Norway is not. But it is part of Europe, which is a geographical area that
runs from Ireland to the Ural mountains in Russia, from the Mediterranean
to the Arctic Circle.

> Not anymore than i would consider 
> America to be a part of the EU. Sure, we're all colloquially
> known as "the west", 

"The West" has nothing to do with this. But for the record, "the West"
includes Australia and New Zealand, which are in the south-east.

> The only ubiquitous
> binding agent between all the member countries is the
> existential need to conglomerate military power against foes
> in the east.

You're thinking of NATO. The EU is primarily a political union designed to
reduce the cost of business when dealing with other European countries. If
it has any military influence, it is that countries that allow free trade
and travel between themselves are less likely to war on each other than
those that don't. Germany is less likely to invade France again, so long as
German business and French business are all part of the same business. At
least the sort of war that involves actual shooting.

[Disclaimer: countries that have little or no contact at all are even less
likely to go to war against each other.]


> Beyond that, the union is superficial at best. 
> If the bailout fails, or another worldwide financial crisis
> hits, the outcome could be disastrous for the EU.

Actually, the best thing for the EU right now would probably be for Greece
to withdraw from the Euro and float their own currency, but otherwise
remain in the EU. Not only would that be the best outcome for Greece, but
it would give the German bureaucrats and the Troika a kick to the seat of
their pants for attempting to interfere in the democratic process. 


> When those pension checks stop coming in the mail, people get
> violent!

The pension cheques stopped coming about 18 months ago, and despite
austerity, despite putting millions of people out of work, despite sticking
a railway spike into the Greek economy (or perhaps because of these three
factors) Greece owes more money now than it did when the Germans declared
economic war on them on behalf of the banks.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#94040

FromEmile van Sebille <emile@fenx.com>
Date2015-07-17 16:15 -0700
Message-ID<mailman.667.1437174927.3674.python-list@python.org>
In reply to#93985
On 7/17/2015 3:45 PM, Terry Reedy wrote:

> Now my question for you or anyone else: If the vast majority of Python
> programmers are focused on 2.7,

I consider myself in this group.

> why are volunteers to help fix 2.7 bugs so scarce?

perhaps the bugs that are show stoppers are providing the impetus to 
move forward to 3.x rather than fix?  This may be an argument to stop 
back-porting fixes.  (security bugs being the exception)

> Does they all consider it perfect (or sufficient) as is?

I have a number of one-off projects in place and running without issues 
on python versions all the way back to probably 1.52 (it's turtles all 
the way down)  In all cases, the python version is perfect (or 
sufficient) as it sits.  I do continue to support the applications and 
find myself writing mostly in some common core level of 2.x.

> Should the core developers who do not personally use 2.7 stop
> backporting, because no one cares if they do?

That'd work for me.  I'm not looking to upgrade the python versions of 
functioning productive code.  Of course, neither are my customers 
looking to pay for me to f*ck^h^h^h^hupgrade up their non-buggy systems.

Emile




[toc] | [prev] | [next] | [standalone]


#94008

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2015-07-17 08:26 -0400
Message-ID<mailman.645.1437136002.3674.python-list@python.org>
In reply to#93977
On Fri, 17 Jul 2015 13:01:42 +1000, Chris Angelico <rosuav@gmail.com>
declaimed the following:

>
>Really? That low? Wow. I guess 90% could count as Rick's declared
>"vast majority", although that term does imply more like 99%.
>
	Since 51% would constitute a majority (anything greater than half of
the sample population is a majority), I'd think 90% could be a "vast
majority".

	99% would be just shy of being unanimous.

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#93984

FromLarry Hudson <orgnut@yahoo.com>
Date2015-07-16 20:49 -0700
Message-ID<cIqdnVHNy_XG5jXInZ2dnUU7-cudnZ2d@giganews.com>
In reply to#93891
On 07/15/2015 08:11 PM, Chris Angelico wrote:
> On Thu, Jul 16, 2015 at 1:01 PM, Larry Hudson via Python-list
> <python-list@python.org> wrote:
>> On 07/15/2015 05:11 AM, Chris Angelico wrote:
>>>
[snip]
>>>
>> In addition to using print(), in some places I like using input() instead,
>> as in:
>>      input('x={}, y={} --> '.format(x, y))
>> Then the program stops at that point so you can study it.
>> To continue just press <Enter>, or Ctrl-C to abort.
>
> That's a neat trick, as long as you actually do have a console. IIDPIO
> is extremely general (works across languages, across frameworks (eg a
> web server), etc), but these kinds of extensions are pretty handy when
> they make sense.
>
> ChrisA
>
Actually, that was an (unstated) point -- it's handy where it _can_ be used and makes sense, but 
it is certainly not a universal technique.

Also I didn't specifically point out the '-->' that I use at the end of the string as an input 
prompt.  Obviously, optional as well.

      -=- Larry -=-

[toc] | [prev] | [next] | [standalone]


#94304

From"Jason P." <suscricions@gmail.com>
Date2015-07-21 10:38 -0700
Message-ID<40474894-45e0-46fd-92b8-486b83d23d29@googlegroups.com>
In reply to#93870
El miércoles, 15 de julio de 2015, 14:12:08 (UTC+2), Chris Angelico  escribió:
> On Wed, Jul 15, 2015 at 9:44 PM, Jason P. <suscricions@gmail.com> wrote:
> > I can't understand very well what's happening. It seems that the main thread gets blocked listening to the web server. My intent was to spawn another process for the server independent of the test. Obviously I'm doing something wrong. I've made several guesses commenting pieces of code (tearDown method for example) but I didn't manage to solve the problem(s).
> >
> 
> When you find yourself making guesses to try to figure out what's
> going on, here are two general tips:
> 
> 1) Cut out as many pieces as you can. Test one small thing at a time.
> 2) If In Doubt, Print It Out! Stick print() calls into the code at key
> places, displaying the values of parameters or the results of
> intermediate calculations - or just saying "Hi, I'm still here and I'm
> running!".
> 
> For #1, I would recommend first just trying to get the web service
> going. Can you connect (using an external program) on port 8000 and
> receive a text/plain HTTP response saying "Hello World!"? Never mind
> about the test for the moment.
> 
> And for #2, judicious placement of console output will help you figure
> out things you're not sure about. For instance, you're suspecting that
> the main thread is getting blocked handling the web server. Easy way
> to check:
> 
>     def setUp(self):
>         # Start the forecast server
>         self.server = ForecastServer()
>         self.server.start(webservice.app)
> 
> Just before you construct the server, print something out. After
> you've constructed it but before you call start(), print something
> out. And after starting it, print something out. Then run the program.
> If you see the first line and no other, then it's blocking during the
> construction. Other deductions I'm sure you can figure out.
> 
> One small point: Probe even things that you think are trivial. In the
> above example, I cannot see any reason why constructing
> ForecastServer() could possibly block, because its init does nothing
> but set a flag. But you can get surprised by things sometimes - maybe
> the problem is actually that you're not running the code you think you
> are, but there's some other ForecastServer kicking in, and it's
> synchronous rather than subprocess-based.
> 
> End-to-end testing is all very well, but when something goes wrong,
> the key is to break the program down into smaller parts. Otherwise,
> all you have is "it doesn't work", which is one of the most useless
> error reports ever. If someone comes to python-list saying "it doesn't
> work", we'll be asking him/her to give a lot more details; if your
> aunt asks you for help printing out a document because "it doesn't
> work", you'll probably have to go over and watch her attempt it; and
> it's the same with your test cases - you make them tell you more
> details.
> 
> Hope that helps! The techniques I'm offering are completely
> problem-independent, and even language-independent. IIDPIO debugging
> works in anything that gives you a console, which is pretty much
> everything - maybe it won't be print() but logging.debug(), but the
> same technique works.
> 
> ChrisA


Thanks for your comments Chris.

I've come back to the problem today after a few days on trip. Fortunately someone in other mailing list pointed me that the join method was hanging the main thread. Without this inconvenience I can focus on the exercise's main goal.

Despite the impression that surely I gave, I'm quite familiar with programming and general bug hunting rules. The problem is that I'm inexperienced with Python and the subtle details of multiple threads ;)

Thanks!

[toc] | [prev] | [next] | [standalone]


#94306

FromChris Angelico <rosuav@gmail.com>
Date2015-07-22 03:48 +1000
Message-ID<mailman.827.1437500893.3674.python-list@python.org>
In reply to#94304
On Wed, Jul 22, 2015 at 3:38 AM, Jason P. <suscricions@gmail.com> wrote:
> Despite the impression that surely I gave, I'm quite familiar with programming and general bug hunting rules. The problem is that I'm inexperienced with Python and the subtle details of multiple threads ;)
>

Heh, it doesn't hurt to remind people of basic debugging techniques
sometimes. Worst case, you come back and say "Yep, I tried that, and
here's the result". Best case, someone else (who doesn't know what you
know) will come along with a superficially similar problem, will see
the suggested technique, and even if the actual issue is quite
different, will be better able to diagnose it.

ChrisA

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web