[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?

James Newton

2/21/2008 2:47:00 PM

Duncan Booth wrote:
> The easiest way in Python to implement a singleton is just to
> use a module: all modules are singletons and there is a
> defined mechanism (import) for accessing them.

Hi Duncan,

I'm intrigued by this idea.

Could you give a bare-bones demonstration of it that the relative newbie
that I am can understand?

Thanks in advance,

James
2 Answers

Mel

2/21/2008 3:12:00 PM

0

James Newton wrote:
> Duncan Booth wrote:
>> The easiest way in Python to implement a singleton is just to
>> use a module: all modules are singletons and there is a
>> defined mechanism (import) for accessing them.
[ ... ]
> Could you give a bare-bones demonstration of it that the relative newbie
> that I am can understand?

I had a club-membership application that ran for several years.
Default pathnames, etc. for the particular year came from a module
called thisyear.py:
#=========================


'''Values used to access this years trakkers files.
$Id: thisyear.py,v 1.2 2006/08/26 16:30:23 mwilson Exp $
'''

memberpath = '2006-7/20062007.txt' # path to this years membership CSV
dirname = '2006-7' # directory name for this year


#=========================
Programs that needed to use the comma-separated-value membership base
would import thisyear, and pass thisyear.memberpath when creating the
CSV reader object. Etc.



Mel.

Dennis

6/15/2014 6:21:00 AM

0

Giborah wrote:

> On Tuesday, June 10, 2014 10:06:34 PM UTC-7, Dennis wrote:
>> JJ wrote:
>>

>> > Quote:
>>
>> >
>>
>> > Fortunately, three great 20th-century rabbinic authorities have
>>
>> > explicated the halachic grounds for such a positive and welcoming
>>
>> > policy : Rabbi Ben-Zion Uziel (1880-1953), Rabbi Joseph Mesas
>>
>> > (1892-1974) and Rabbi Hayyim David HaLevi (1924-1998).
>>
>> >
>>
>> > Uziel, the first Sephardic chief rabbi of Israel, notes that
>> > classic
>>
>> > rabbinic texts teach us that God loves converts. The Talmud states
>>
>> > that God dispersed the Jews throughout the world so that non-Jews
>>
>>>>
>> > would have the opportunity to become acquainted with them and
>> > choose
>>
>> > to convert. It is a positive commandment to warmly accept
>> > proselytes,
>>
>> > whenever this is permitted by the law of the land. Uzzel writes:
>>
>> > "According to Torah, it is both permitted and a commandment to
>> > accept
>>
>> > men and women converts, even if we are aware that they will not
>>
>> > observe all the commandments."
>>
>> >
>>
>> >
>>
>> > Read more:
>>
>> >
>>
>> > http://forward.com/articles/199505/the-talmudic-case-for-c...
>> > #ix
>>
>> > zz33ry2Th00
>>
>>
>>
>>
>>
>> What specifically do they mean saying that "they will not observe all
>> the
>>
>> commandments"? Keep kosher?
>>
>>
>>
>> Most American men are circumcised so you only need to draw the ritual
>>
>> pinprick (I wouldn't look forward to that) If you have to do a full
>>
>> circumcision, at least we have anesthetics today.
>>
>>
>>
>> FWIW, a book I recently read said that circumsision originally meant
>> only
>>
>> a nick; after ~150 CE it was the whole foreskin. that would explain
>> the
>>
>> stories about men removing the mark of circumcision.
>
> Pls give title of book. The way Zipporah was supposed to have done
> her man with a piece of flint is made to sound much ouchier. Just
> curious.
>
> Giborah
>>


A Cultural Handbook to the Bible Paperback
by John J. Pilch (Author)

http://www.amazon.com/Cultural-Handbook-Bible-John-Pilch/dp/0...