Re: [pypy-dev] A quick question for you!

2018-06-19 Thread William ML Leslie
On 18 June 2018 at 22:18, Etienne Robillard wrote: > Hi, > > Quick question: Does anyone of you know what is the effect of enabling > gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for > long-lived WSGI applications? > gc is enabled by default. you only need to use gc.ena

Re: [pypy-dev] A quick question for you!

2018-06-19 Thread Etienne Robillard
Le 2018-06-18 à 22:47, William ML Leslie a écrit : On 18 June 2018 at 22:18, Etienne Robillard wrote: Hi, Quick question: Does anyone of you know what is the effect of enabling gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for long-lived WSGI applications? gc is en

A quick question for you!

2018-06-18 Thread Etienne Robillard
Hi, Quick question: Does anyone of you know what is the effect of enabling gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for long-lived WSGI applications? Thanks, Etienne -- Etienne Robillard tkad...@yandex.com https://www.isotopesoftware.ca/ -- https://mail.pytho

Re: Just a quick question about main()

2017-10-27 Thread Ian Kelly
On Oct 27, 2017 5:38 PM, "Ian Kelly" wrote: In addition to what others have answered, if the code in question has any variables then I'll prefer to put it inside a function and call the function. This ensures that the variables are local and not going. It's a minor code hygiene point, but a good

Re: Just a quick question about main()

2017-10-27 Thread Ian Kelly
In addition to what others have answered, if the code in question has any variables then I'll prefer to put it inside a function and call the function. This ensures that the variables are local and not going. It's a minor code hygiene point, but a good practice in my opinion. -- https://mail.pytho

Re: Just a quick question about main()

2017-10-27 Thread Ned Batchelder
On 10/27/17 2:05 PM, ROGER GRAYDON CHRISTMAN wrote: While teaching my introductory course in Python, I occasionally see submissions containing the following two program lines, even before I teach about functions and modules: if __name__ = '__main__': ... main() When I ask about it, I hear thin

Re: Just a quick question about main()

2017-10-27 Thread Grant Edwards
On 2017-10-27, Chris Angelico wrote: > On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: >> While teaching my introductory course in Python, I occasionally see >> submissions containing the following two program lines,[...] >> if __name__ = '__main__': >> ... main() > If it's JUS

Re: Just a quick question about main()

2017-10-27 Thread Thomas Jollans
On 27/10/17 20:05, ROGER GRAYDON CHRISTMAN wrote: > While teaching my introductory course in Python, I occasionally see > submissions containing the following two program lines, even before > I teach about functions and modules: > > if __name__ = '__main__': > ... main() > > When I ask about it,

Re: Just a quick question about main()

2017-10-27 Thread Chris Angelico
On Sat, Oct 28, 2017 at 5:23 AM, Chris Angelico wrote: > On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: >> While teaching my introductory course in Python, I occasionally see >> submissions containing the following two program lines, even before >> I teach about functions and mod

Re: Just a quick question about main()

2017-10-27 Thread Chris Angelico
On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: > While teaching my introductory course in Python, I occasionally see > submissions containing the following two program lines, even before > I teach about functions and modules: > > if __name__ = '__main__': > ... main() > > When I

Just a quick question about main()

2017-10-27 Thread ROGER GRAYDON CHRISTMAN
While teaching my introductory course in Python, I occasionally see submissions containing the following two program lines, even before I teach about functions and modules: if __name__ = '__main__': ... main() When I ask about it, I hear things like they got these from other instructors, or from

Re: A quick question

2008-05-28 Thread Bruno Desthuilliers
D'Arcy J.M. Cain a écrit : On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person p

Re: A quick question

2008-05-28 Thread Chris
On May 28, 12:25 pm, "James" <[EMAIL PROTECTED]> wrote: > Hey everyone, > > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards.  For example if the person puts in "cat" I want the > program to

Re: A quick question

2008-05-28 Thread Bruno Desthuilliers
James a écrit : Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person puts in "cat" I want the program to give it back as "tac" and what it does is prin

Re: A quick question

2008-05-28 Thread Paul Hankin
On May 28, 11:25 am, "James" <[EMAIL PROTECTED]> wrote: > word = raw_input("Type a word:") > start = len(word) > > for letter in range(start, 0, -1): > print letter Hi James, for letter in reversed(word): print letter -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list

Re: A quick question

2008-05-28 Thread D'Arcy J.M. Cain
On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: > Hey everyone, > > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards. For example if the person puts in "cat" I want

Re: A quick question

2008-05-28 Thread D'Arcy J.M. Cain
On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards. For example if the person puts in "cat" I want the > program to g

A quick question

2008-05-28 Thread James
Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person puts in "cat" I want the program to give it back as "tac" and what it does is prints out 3,2,1. Ho

Re: a quick question about namespaces

2005-02-01 Thread Steven Bethard
Jay donnell wrote: in the code below 'print locals()' shows mc2. What is the equivalent way to see the namespace that mc resides in? class myClass: --def func1(self): self.mc = 1 mc2 = 3 print 'in myClass.func1' print 'printing locals' print locals() print I think you're loo

a quick question about namespaces

2005-02-01 Thread Jay donnell
in the code below 'print locals()' shows mc2. What is the equivalent way to see the namespace that mc resides in? class myClass: --def func1(self): self.mc = 1 mc2 = 3 print 'in myClass.func1' print 'printing locals' print locals() print Google mungs up the spacing so I p