[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

RE: Globals or objects? (is: module as singleton

James Newton

2/21/2008 5:03:00 PM

Duncan Booth wrote:
> you can create additional module instances (by calling new.module)

Hi Duncan,

Could you provide a scenario where this would be useful (and the best
practice)?

> What you get with a module is support for locating a specific module
> and ensuring that you don't get duplicate copies of a named module.

So if I were to execute the following pseudo-code, the second 'import'
would simply point at the module (instance) imported the first time:

import mymodule
changeContentsOf("mymodule.py") #on the hard disk
import mymodule

The values, functions and classes available in mymodule would only
change if I were to restart the application.

> Regarding your question about saving the values: what you would
> usually do would be to store the values in a separate configuration
> file and the module would load them on startup and then rewrite the
> configuration file when you call a save function...

That's what I would normally do, too.

Thanks for your help,

James
23 Answers

Duncan Booth

2/22/2008 10:43:00 AM

0

"James Newton" <jnewton@fuelindustries.com> wrote:

> Duncan Booth wrote:
>> you can create additional module instances (by calling new.module)
>
> Hi Duncan,
>
> Could you provide a scenario where this would be useful (and the best
> practice)?

Not really as such cases are few and far between. Try grepping the standard
library for a few examples where new.module is called.

>> What you get with a module is support for locating a specific module
>> and ensuring that you don't get duplicate copies of a named module.
>
> So if I were to execute the following pseudo-code, the second 'import'
> would simply point at the module (instance) imported the first time:
>
> import mymodule
> changeContentsOf("mymodule.py") #on the hard disk
> import mymodule
>
> The values, functions and classes available in mymodule would only
> change if I were to restart the application.

Yes, you could call 'reload(mymodule)' to force it to reload but otherwise
once it has been imported once any subsequent imports just return the
existing module.

William Black

6/13/2014 8:25:00 PM

0

On Fri, 13 Jun 2014 08:07:49 -0700 (PDT), jerry kraus
<jkraus1999@gmail.com> wrote:

>On Thursday, June 12, 2014 8:15:40 PM UTC-5, The Horny Goat wrote:
>> On Thu, 12 Jun 2014 13:45:14 -0700 (PDT), jerry kraus
>
>>
>> You are seriously delusional if you think the Japanese camps in the US
>>
>> and Canada resembled Dachau, Buchenwald and the others.
>>
>>
>>
>> Do you seriously think the Nazis could have recruited the most
>>
>> decorated unit in the German army from interned German Jews?
>>
>>
>>
>> Do you seriously think the Germans could have raised a unit as large
>>
>> as the 442nd Regimental Combat Team?
>>
>>
>>
>> I'd say they'd do well to raise a SQUAD.
>>
>>
>>
>> Completely apples and oranges friend apples and oranges.
>
>Well, I don't know about that. A concentration camp's a concentration camp.

That's a bloody silly statement.

> I didn't say the American and Canadian camps were extermination camps, as were the Nazi camps for Jews. On the other hand, the Americans and the Canadians weren't losing the war, were they? That's my point. The Nazis moved from a policy of relocation to a policy of extermination when they started losing.

No.

They were exterminating people within days of invading Poland.

> Hermann Goring specifically notes that relocation is "impractical" during wartime -- he's expecting a long war, and he's not sure he's going to win it.

Actually he';s utterly certain he's going to win it at the point where
extermination is decided on.

> The Germans suffered 95% of their 10,000,000 casualties in WWII on the Eastern Front -- the magnitude of the Jewish extermination directly parallels the magnitude of their losses. Systematic extermination began in August, 1941, in Lithuania.

No, earlier, and in Poland.

65,000 by the end of 1939.

http://en.wikipedia.org/wiki/Einsatzgruppen#Invasion...


> Why? Presumably, the Nazis hoped that, somehow, exorcising their Jewish enemies in Russia would win them the war.

Actually they knew it wouldn't help their war effort. Indeed the
'Office of the four year plan' representative at Wannsee objects to
the extermination on exactly those grounds. See the Wannsee
Conference documents for details.

Jerry Kraus

6/13/2014 8:49:00 PM

0

On Friday, June 13, 2014 3:24:48 PM UTC-5, Bill wrote:
> On Fri, 13 Jun 2014 08:07:49 -0700 (PDT), jerry kraus
>
> <jkraus1999@gmail.com> wrote:
>
>
> > I didn't say the American and Canadian camps were extermination camps, as were the Nazi camps for Jews. On the other hand, the Americans and the Canadians weren't losing the war, were they? That's my point. The Nazis moved from a policy of relocation to a policy of extermination when they started losing.
>
>
>
> No.
>
>
>
> They were exterminating people within days of invading Poland.
>
They were killing people they didn't like, but they weren't exterminating Jews particularly. Jews were 10% of the Polish population, no intention existed at this stage to wipe them out, as was eventually done only after the final solution was decided on.
>
>
> > Hermann Goring specifically notes that relocation is "impractical" during wartime -- he's expecting a long war, and he's not sure he's going to win it.
>
>
>
> Actually he';s utterly certain he's going to win it at the point where
>
> extermination is decided on.
>
He may or may not think he'll win. He knows it's going to be long, and very difficult. Otherwise, Jews could simply be relocated, as was the initial Nazi plan.
>
>
> > The Germans suffered 95% of their 10,000,000 casualties in WWII on the Eastern Front -- the magnitude of the Jewish extermination directly parallels the magnitude of their losses. Systematic extermination began in August, 1941, in Lithuania.
>
>
>
> No, earlier, and in Poland.
>
>
>
> 65,000 by the end of 1939.
>
Those are total figures for all Poles executed by the Nazis, not Jews specifically. I never said the Nazis weren't brutal and bloody. Just that there was no intention at this stage to exterminate the Jews of Poland. There wasn't. Not yet, anyway. Not until 1942.
>
>
> http://en.wikipedia.org/wiki/Einsatzgruppen#Invasion...
>
>
>
>
>
> > Why? Presumably, the Nazis hoped that, somehow, exorcising their Jewish enemies in Russia would win them the war.
>
>
>
> Actually they knew it wouldn't help their war effort. Indeed the
>
> 'Office of the four year plan' representative at Wannsee objects to
>
> the extermination on exactly those grounds. See the Wannsee
>
> Conference documents for details.

Oh, I'm not saying there was universal agreement on this point. After all, it makes no sense whatsoever. But, no one said the Nazis, as a group, were particularly rational. In their mystical world-view, the extermination of Jews was, I think, "good karma", if you like.

Jerry Kraus

6/13/2014 9:03:00 PM

0

On Friday, June 13, 2014 3:24:48 PM UTC-5, Bill wrote:
> On Fri, 13 Jun 2014 08:07:49 -0700 (PDT), jerry kraus
>
> <jkraus1999@gmail.com> wrote:
>
>
>
> >On Thursday, June 12, 2014 8:15:40 PM UTC-5, The Horny Goat wrote:
>
> >> On Thu, 12 Jun 2014 13:45:14 -0700 (PDT), jerry kraus
>
> >
>
> >>
>
> >> You are seriously delusional if you think the Japanese camps in the US
>
> >>
>
> >> and Canada resembled Dachau, Buchenwald and the others.
>
> >>
>
> >>
>
> >>
>
> >> Do you seriously think the Nazis could have recruited the most
>
> >>
>
> >> decorated unit in the German army from interned German Jews?
>
> >>
>
> >>
>
> >>
>
> >> Do you seriously think the Germans could have raised a unit as large
>
> >>
>
> >> as the 442nd Regimental Combat Team?
>
> >>
>
> >>
>
> >>
>
> >> I'd say they'd do well to raise a SQUAD.
>
> >>
>
> >>
>
> >>
>
> >> Completely apples and oranges friend apples and oranges.
>
> >
>
> >Well, I don't know about that. A concentration camp's a concentration camp.
>
>
>
> That's a bloody silly statement.
>
>
>
> > I didn't say the American and Canadian camps were extermination camps, as were the Nazi camps for Jews. On the other hand, the Americans and the Canadians weren't losing the war, were they? That's my point. The Nazis moved from a policy of relocation to a policy of extermination when they started losing.
>
>
>
> No.
>
>
>
> They were exterminating people within days of invading Poland.
>
>
>
> > Hermann Goring specifically notes that relocation is "impractical" during wartime -- he's expecting a long war, and he's not sure he's going to win it.
>
>
>
> Actually he';s utterly certain he's going to win it at the point where
>
> extermination is decided on.
>
>
>
> > The Germans suffered 95% of their 10,000,000 casualties in WWII on the Eastern Front -- the magnitude of the Jewish extermination directly parallels the magnitude of their losses. Systematic extermination began in August, 1941, in Lithuania.
>
>
>
> No, earlier, and in Poland.
>
>
>
> 65,000 by the end of 1939.
>
>
>
> http://en.wikipedia.org/wiki/Einsatzgruppen#Invasion...
>
>
>
>
>
> > Why? Presumably, the Nazis hoped that, somehow, exorcising their Jewish enemies in Russia would win them the war.
>
>
>
> Actually they knew it wouldn't help their war effort. Indeed the
>
> 'Office of the four year plan' representative at Wannsee objects to
>
> the extermination on exactly those grounds. See the Wannsee
>
> Conference documents for details.

Bill the key point to remember is that "exterminate" doesn't just mean do a lot of killing. It means "wipe out completely". This notion of a "final solution" is first mentioned by Hermann Goring on July 31, 1941, not before.. The very concept of actually killing all the Jews of Europe isn't really present in Nazi thinking -- certainly not as a practical project -- until midsummer 1941. After they started having a great deal of trouble in Russia, that is.

William Black

6/13/2014 10:12:00 PM

0

On Fri, 13 Jun 2014 13:48:39 -0700 (PDT), jerry kraus
<jkraus1999@gmail.com> wrote:

>On Friday, June 13, 2014 3:24:48 PM UTC-5, Bill wrote:

>>
>>
>> Actually he';s utterly certain he's going to win it at the point where
>>
>> extermination is decided on.
>>
>He may or may not think he'll win. He knows it's going to be long, and very difficult. Otherwise, Jews could simply be relocated, as was the initial Nazi plan.

No, working them all to death was the initial plan, but that was
rejected because they thought that the remnant that would remain would
be the strong ones.

>> No, earlier, and in Poland.

>> 65,000 by the end of 1939.
>>
>Those are total figures for all Poles executed by the Nazis, not Jews specifically.

How many of those were Jewish?

>>
>> > Why? Presumably, the Nazis hoped that, somehow, exorcising their Jewish enemies in Russia would win them the war.
>>
>>
>>
>> Actually they knew it wouldn't help their war effort. Indeed the
>>
>> 'Office of the four year plan' representative at Wannsee objects to
>>
>> the extermination on exactly those grounds. See the Wannsee
>>
>> Conference documents for details.
>
>Oh, I'm not saying there was universal agreement on this point.

Aren't you listening?

The people runing the economy said it would be bad for the economy and
the Nazis didn't care...

They were psychopaths who wanted to kill people for no terribly good
reason.
> After all, it makes no sense whatsoever. But, no one said the Nazis, as a group, were particularly rational. In their mystical world-view, the extermination of Jews was, I think, "good karma", if you like.

You're almost as bonkers as they were.

William Black

6/13/2014 10:17:00 PM

0

On Fri, 13 Jun 2014 14:03:09 -0700 (PDT), jerry kraus
<jkraus1999@gmail.com> wrote:

>On Friday, June 13, 2014 3:24:48 PM UTC-5, Bill wrote:

>>
>> Actually they knew it wouldn't help their war effort. Indeed the
>>
>> 'Office of the four year plan' representative at Wannsee objects to
>>
>> the extermination on exactly those grounds. See the Wannsee
>>
>> Conference documents for details.
>
>Bill the key point to remember is that "exterminate" doesn't just mean do a lot of killing. It means "wipe out completely". This notion of a "final solution" is first mentioned by Hermann Goring on July 31, 1941, not before.

No, that's when the orders were actually given in writing.

Obviously a great deal of discussion went on before that.

Even senior Nazi leaders don't decide to murder eleven million people
on a whim and without either authorisiation or funding.

Goering's letter to Heydrich is just the formal authorisation for him
to go forwards with plans obviously already agreed.

Especially as the resources to be used weren't actually in Goering's
gift, they belonged to the SS...

Dimensional Traveler

6/14/2014 4:08:00 AM

0

On 6/13/2014 2:03 PM, jerry kraus wrote:
>
> Bill the key point to remember is that "exterminate" doesn't just mean do a lot of killing. It means "wipe out completely".
> This notion of a "final solution" is first mentioned by Hermann Goring on July 31, 1941, not before. The very concept of actually
> killing all the Jews of Europe isn't really present in Nazi thinking -- certainly not as a practical project -- until midsummer 1941.
> After they started having a great deal of trouble in Russia, that is.
>
You are an idiot. Here's a hint, the Germans _started_ their invasion
of Russia in, wait for it, midsummer 1941. And proceeded to run rampant
thru Russia. They didn't start having a "great deal of trouble" until
1943. The _winter_ of 1941 was just a temporary setback.

--
"There is some deep burning stupid" - Anim8rFSK, Jun 01 2014

The Horny Goat

6/14/2014 4:17:00 AM

0

On Fri, 13 Jun 2014 13:48:39 -0700 (PDT), jerry kraus
<jkraus1999@gmail.com> wrote:

>Those are total figures for all Poles executed by the Nazis, not Jews specifically. I never said the Nazis weren't brutal and bloody. Just that there was no intention at this stage to exterminate the Jews of Poland. There wasn't. Not yet, anyway. Not until 1942.

Uh the Germans were butchering before 1 Sept 1939. They had been
butchering Polish Jews even before the shooting stopped.

Hitler made his plans for Poland and for Polish Jews in particular
quite clear in Mein Kampf - one can only be wilfully oblivious to
suggest the murders started in 1942.

Don Phillipson

6/14/2014 4:29:00 PM

0

"jerry kraus" <jkraus1999@gmail.com> wrote in message
news:634836ec-5de6-4ffe-afe3-c2931e08882b@googlegroups.com...

> The Nazis moved from a policy of relocation to a policy of extermination
> when they started losing . . . The Germans suffered 95% of their
> 10,000,000 casualties in WWII on the Eastern Front -- the magnitude
> of the Jewish extermination directly parallels the magnitude of their
> losses. . . .
> If the campaign in Russia goes as easily as the campaign in France, why
> change policy, why exterminate the Jews?

This is (half the) argument of Nazi apologists, conveniently omitting:
1. Hitler's government began (secret) extermination of the "unfit"
in 1939. For whatever reason (unknown) the first victims were
mostly Aryans, viz. permanent residents of lunatic asylums and
cripples' hospitals. The Nazi administration had been making
propaganda for "racial hygiene" (Nazi eugenics) for a couple of
years before this, likening the retarded and insane (and Jews as
well) to rats in the social body, that any sensible society would
exterminate.
https://en.wikipedia.org/wiki... estimates the number of (Aryan)
hospital patients exterminated at 200,000.

2. No historical (documented) or logical (plausible) relationship between
East Front combat casualties and extermination camp victims is known.
As noted, extermination began in the earliest months of the war i.e.
when the Nazis were confident in victory and was a state secret that
leaked out only a year or two later.

3. In 1944-45 certain Jew-hunters (notably Eichmann) were spending
significant war resources on the roundup and shipment of Jews to death
camps, i.e. claiming troop time and railway schedule space the generals
wanted more.. (The book Schindler's List includes waste of war resources as
one of Schindler's arguments against relocating Jews: but I do not
know whether this actually happened.)

--
Don Phillipson
Carlsbad Springs
(Ottawa, Canada)



Jerry Kraus

6/14/2014 6:43:00 PM

0

On Friday, June 13, 2014 11:16:50 PM UTC-5, The Horny Goat wrote:
> On Fri, 13 Jun 2014 13:48:39 -0700 (PDT), jerry kraus
>
> <jkraus1999@gmail.com> wrote:
>
>
>
> >Those are total figures for all Poles executed by the Nazis, not Jews specifically. I never said the Nazis weren't brutal and bloody. Just that there was no intention at this stage to exterminate the Jews of Poland. There wasn't. Not yet, anyway. Not until 1942.
>
>
>
> Uh the Germans were butchering before 1 Sept 1939. They had been
>
> butchering Polish Jews even before the shooting stopped.
>
>
>
> Hitler made his plans for Poland and for Polish Jews in particular
>
> quite clear in Mein Kampf - one can only be wilfully oblivious to
>
> suggest the murders started in 1942.

The Nazis were brutal. Nevertheless, the Nazis did not begin a policy of official extermination of Jews until August 1941, in Lithuania, specifically..

Sorry. Violence and willful total extermination are not identical. The former is a control strategy, the latter is genocide. There is a significant difference.