On Tue, Oct 13, 2015 at 2:44 PM, Alex Kleider wrote:
> On 2015-10-13 12:11, Danny Yoo wrote:
>
>
>> ##
>> def make_ask(f, l, p):
>> d = {'Enter your first name: ' : f,
>>'Enter your last name: ' : l,
>>'Your mobile phone #: ' : p}
>> return d.get
On Mon, Oct 12, 2015 at 04:12:57PM +, Albert-Jan Roskam wrote:
> Hi,
>
>
> In Python 2 one can do silly apple-pear comparisons such as 0> "0".*)
> "CPython implementation detail: Objects of different types except
> numbers are ordered by their type names; objects of the same types
> that d
On 13Oct2015 13:43, David Aldrich wrote:
Thanks for all the answers to my question, they were all helpful.
I have one more question, which regards style. Suppose my 'send' method is in
its own module: TxControl, along with the custom exceptions:
TxControl.py:
class MessageTimeoutError(Excep
On 2015-10-13 12:11, Danny Yoo wrote:
##
def make_ask(f, l, p):
d = {'Enter your first name: ' : f,
'Enter your last name: ' : l,
'Your mobile phone #: ' : p}
return d.get
##
This last line got my attention ("a dict has no
On 13.10.2015 15:43, David Aldrich wrote:
>
I have one more question, which regards style. Suppose my 'send' method is in
its own module: TxControl, along with the custom exceptions:
TxControl.py:
class MessageTimeoutError(Exception): pass
class UndefinedMessageTypeError(Exception): pass
def
> Then it seems that an importer of that module must include the module name
> when referencing the exceptions:
>
> import TxControl
>
> try:
> send(msg)
> except (TxControl.MessageTimeoutError, TxControl.UndefinedMessageTypeError)
> as err:
> # Exception processing
>
> Including 'TxContr
On Sat, Oct 10, 2015 at 5:41 PM, Alex Kleider wrote:
> """
> I'm trying to follow a test driven development paradigm (using
> unittest) but can't figure out how to test functions that collect
> info from the command line such as the following.
> """
> # collect.py
> def collect_data():
> ret =
> If you don't want to let the original timeout error bubble up you can create
> your own little hierarchy of exceptions:
>
> class ResponseError(Exception):
> pass
>
> class TimeoutError(ResponseError):
> pass
>
> class BadDataError(ResponseError):
> pass
>
> Then the baseclass of
On Mon, Oct 12, 2015 at 7:55 AM, David Aldrich
wrote:
> Hi
>
> Consider a 'send' method that sends a message to another system via a socket.
> This method will wait for a response before returning. There are two
> possible error conditions:
>
> 1) Timeout - i.e. no response received
>
> 2
> In Python 2 one can do silly apple-pear comparisons such as 0> "0".*)
> "CPython implementation detail: Objects of different types except numbers are
> ordered by their type names; objects of the same types that don’t support
> proper comparison are ordered by their address.". In Python3 this
Greetings Albert-Jan,
I have a suggestion and a comment in this matter.
Yes, a justified fear of making mistakes. That is, a mistake has
already occurred and I don't want it to happen again.
Suggestion: Choose a single in-memory representation of your data
and make all of your input and ou
From: oscar.j.benja...@gmail.com
Date: Mon, 12 Oct 2015 20:37:43 +
Subject: Re: [Tutor] 0> "0" --> is there a "from __future__ import to make this
raise a TypeError?
To: sjeik_ap...@hotmail.com; tutor@python.org
On Mon, 12 Oct 2015 17:15 Albert-Jan Roskam wrote:
Hi,
In Python 2 one can
David Aldrich wrote:
> Consider a 'send' method that sends a message to another system via a
> socket. This method will wait for a response before returning. There are
> two possible error conditions:
>
>
> 1) Timeout - i.e. no response received
>
> 2) Illegal response received
>
>
13 matches
Mail list logo