On Thu, Jun 19, 2014 at 11:10:26AM -0700, Alex Kleider wrote:
> The idea of a singleton class is new to me as is this comparison of
> class vs module.
> Can anyone suggest a place to turn for more discussion of the topic?
> thks, alexK
"Singleton" is one of the classic "design patterns", althoug
- Original Message -
> From: Alex Kleider
> To: tutor@python.org
> Cc:
> Sent: Thursday, June 19, 2014 8:10 PM
> Subject: Re: [Tutor] Tips
>
> On 2014-06-18 18:37, Steven D'Aprano wrote:
>> Python tries very hard to ensure that every module is
On 2014-06-18 18:37, Steven D'Aprano wrote:
Python tries very hard to ensure that every module is loaded only once.
(There are circumstances where you can fool it, but they're rare.)
Since
the module holds state (variables) and behaviour (functions), modules
perform the same sort of role as cla
- Original Message -
> From: Mark Lawrence
> To: tutor@python.org
> Cc:
> Sent: Thursday, June 19, 2014 2:40 PM
> Subject: Re: [Tutor] Tips
>
> On 19/06/2014 10:09, Albert-Jan Roskam wrote:
>>> From: Mark Lawrence
>>> To: tutor@python.org
>
On Tue, Jun 17, 2014 at 02:52:33PM -0400, keith papa wrote:
>
> Hi, I want to no what some tips or information you can give me to
> remember some of the rules of python, when you first start learning
> programming?
Questions about memory (that is, *human* memory, in the brain) are not
really on
On 19/06/2014 10:09, Albert-Jan Roskam wrote:
- Original Message -
From: Mark Lawrence
To: tutor@python.org
Cc:
Sent: Thursday, June 19, 2014 8:41 AM
Subject: Re: [Tutor] Tips
On 19/06/2014 02:36, Danny Yoo wrote:
[content about __add__ dispatch resolution cut]
We should
On Wed, Jun 18, 2014 at 06:36:12PM -0700, Danny Yoo wrote:
> [content about __add__ dispatch resolution cut]
>
>
> We should remember the target audience, lest this thread doesn't
> spiral away so that only the tutors are talking to each other. I'm
> guilty of this as anyone, mind you. Pot. Ke
On 19/06/2014 03:37, Steven D'Aprano wrote:
On Wed, Jun 18, 2014 at 12:35:20PM +0200, Sydney Shall wrote:
On 17/06/2014 22:35, Alan Gauld wrote:
Use modules instead of singleton classes
As a new beginner with Python, I am having problem understanding the
difference here.
I think I understand c
- Original Message -
> From: Mark Lawrence
> To: tutor@python.org
> Cc:
> Sent: Thursday, June 19, 2014 8:41 AM
> Subject: Re: [Tutor] Tips
>
> On 19/06/2014 02:36, Danny Yoo wrote:
>> [content about __add__ dispatch resolution cut]
>>
>>
>
- Original Message -
> From: Steven D'Aprano
> To: tutor@python.org
> Cc:
> Sent: Thursday, June 19, 2014 3:17 AM
> Subject: Re: [Tutor] Tips
>
> On Wed, Jun 18, 2014 at 07:25:41AM -0700, Albert-Jan Roskam wrote:
>
>> Given that the concept of Du
On 19/06/2014 02:36, Danny Yoo wrote:
[content about __add__ dispatch resolution cut]
We should remember the target audience, lest this thread doesn't
spiral away so that only the tutors are talking to each other. I'm
guilty of this as anyone, mind you. Pot. Kettle. :P
The original questi
On Wed, Jun 18, 2014 at 12:35:20PM +0200, Sydney Shall wrote:
> On 17/06/2014 22:35, Alan Gauld wrote:
> >Use modules instead of singleton classes
> As a new beginner with Python, I am having problem understanding the
> difference here.
> I think I understand classes, but still have problems with
[content about __add__ dispatch resolution cut]
We should remember the target audience, lest this thread doesn't
spiral away so that only the tutors are talking to each other. I'm
guilty of this as anyone, mind you. Pot. Kettle. :P
The original question that the OP posed was:
I want to
On Wed, Jun 18, 2014 at 07:25:41AM -0700, Albert-Jan Roskam wrote:
> Given that the concept of Ducktyping has already been mentioned, is
> there a reason why you did not mention try-except?
>
> def add(a, b):
> try:
> return a + b
> except TypeError:
> raise
As others
Sydney Shall Wrote in message:
>
but I do not understand what defines a module
Please post in plain text, not html.
A module is a source file (eg. .py) or a compiled source file (eg
.pyc) that's generally intended to be used via an import.
--
DaveA
___
On 18/06/2014 20:17, Albert-Jan Roskam wrote:
- Original Message -
From: Mark Lawrence
To: tutor@python.org
Cc:
Sent: Wednesday, June 18, 2014 9:03 PM
Subject: Re: [Tutor] Tips
On 18/06/2014 15:25, Albert-Jan Roskam wrote:
- Original Message -
From: Alan Gauld
To
- Original Message -
> From: Mark Lawrence
> To: tutor@python.org
> Cc:
> Sent: Wednesday, June 18, 2014 9:03 PM
> Subject: Re: [Tutor] Tips
>
> On 18/06/2014 15:25, Albert-Jan Roskam wrote:
>> - Original Message -
>>> From: Alan Gaul
On 18/06/2014 15:25, Albert-Jan Roskam wrote:
- Original Message -
From: Alan Gauld
To: tutor@python.org
Cc:
Sent: Wednesday, June 18, 2014 11:47 AM
Subject: Re: [Tutor] Tips
On 18/06/14 01:15, Nanohard wrote:
On 2014-06-17 13:35, Alan Gauld wrote:
Don't test types, us
On 18/06/14 15:25, Albert-Jan Roskam wrote:
Just do this:
def add(a,b):
return a+b
Given that the concept of Ducktyping has already been mentioned, is there a
reason why you did not mention try-except?
def add(a, b):
try:
return a + b
except TypeError:
rais
- Original Message -
> From: Alan Gauld
> To: tutor@python.org
> Cc:
> Sent: Wednesday, June 18, 2014 11:47 AM
> Subject: Re: [Tutor] Tips
>
> On 18/06/14 01:15, Nanohard wrote:
>>> On 2014-06-17 13:35, Alan Gauld wrote:
>>>
>>>> Do
On 17/06/2014 22:35, Alan Gauld wrote:
Use modules instead of singleton classes
As a new beginner with Python, I am having problem understanding the
difference here.
I think I understand classes, but still have problems with inheritance,
but I do not understand what defines a module.
With many
On 18/06/14 01:15, Nanohard wrote:
On 2014-06-17 13:35, Alan Gauld wrote:
Don't test types, use the interface
Can you please explain what you mean by this?
He means use the Python interpreter, by going to your console and typing
"python", or in Windows
it's called 'IDLE'.
Nope, I meant
> On 2014-06-17 13:35, Alan Gauld wrote:
>
>> Don't test types, use the interface
>
> Can you please explain what you mean by this?
> alex
He means use the Python interpreter, by going to your console and typing
"python", or in Windows
it's called 'IDLE'.
__
On 18/06/2014 01:02, Alex Kleider wrote:
On 2014-06-17 13:35, Alan Gauld wrote:
Don't test types, use the interface
Can you please explain what you mean by this?
alex
Further to Danny Yoo's response have a read of this
http://en.wikipedia.org/wiki/Duck_typing
--
My fellow Pythonistas, a
On Tue, Jun 17, 2014 at 5:02 PM, Alex Kleider wrote:
> On 2014-06-17 13:35, Alan Gauld wrote:
>
>> Don't test types, use the interface
>
>
> Can you please explain what you mean by this?
If you are writing type tests on a function's inputs, you might better
off by having the inputs implement an
On 2014-06-17 13:35, Alan Gauld wrote:
Don't test types, use the interface
Can you please explain what you mean by this?
alex
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listi
On 17/06/14 19:52, keith papa wrote:
Hi, I want to no what some tips or information you can give me to
> remember some of the rules of python,
> when you first start learning programming?
Most of my tips/rules are about programming rather than python...
--
Hi, I want to no what some tips or information you can give me to remember some
of the rules of python, when you first start learning programming?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.pytho
On Mon, Jan 11, 2010 at 12:33 AM, VacStudent wrote:
> I would like to get a python book, how and where to get one?
Amazon.com? Or lots of free resources online.
Kent
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
I would like to get a python book, how and where to get one?
Jappie Monele
Mechanical Engineer Student
Koffiefontein Blue Diamond Mine JV
Petra Diamonds
Group Management Office: Elizabeth House, 9 Castle Street, St. Helier,
Jersey, JE4 2QP
South African Office: Block 3, Silver Point Of
"Mat Newport" <[EMAIL PROTECTED]> wrote
> Basically the program would scan a specified folder,
> build a list of specific files (.txt in the example below),
Look at the glob module and its glob function.
Or if you want to include subdirectories lkook at the
os.walk function. There are example
Mat Newport wrote:
> I have taken a fundamentals of programming course at a local college, but
> that class does not provide the level of expertise to write a program I have
> in mind. So I do have basic skills, I just need to be shown the tools to
> write this thing and I think I could put it a
I have taken a fundamentals of programming course at a local college, but that
class does not provide the level of expertise to write a program I have in
mind. So I do have basic skills, I just need to be shown the tools to write
this thing and I think I could put it all together.
Basically the
33 matches
Mail list logo