[BangPypers] BangPypers Digest, Vol 69, Issue 7

Jagadeesh N. Malakannavar mnjagadeesh at gmail.com
Thu May 9 17:19:04 CEST 2013


Wonderful discussion. Thanks for all replies.

To my eyes map() looked better so just used it. Yes list comprehension is
better idea.

Thanks


On Thu, May 9, 2013 at 1:54 PM, <bangpypers-request at python.org> wrote:

> Send BangPypers mailing list submissions to
>         bangpypers at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.python.org/mailman/listinfo/bangpypers
> or, via email, send a message with subject or body 'help' to
>         bangpypers-request at python.org
>
> You can reach the person managing the list at
>         bangpypers-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of BangPypers digest..."
>
>
> Today's Topics:
>
>    1. Re: Another qn. THanks for the basic of basic qn\
>       (Jagadeesh N. Malakannavar)
>    2. Re: Another qn. THanks for the basic of basic qn\ (Gora Mohanty)
>    3. Re: Another qn. THanks for the basic of basic qn\ (Noufal Ibrahim)
>    4. A Comparison of Mocking Frameworks (Sriram Narayanan)
>    5. Re: Another qn. THanks for the basic of basic qn\ (Gora Mohanty)
>    6. [Ticket #27]  A Comparison of Mocking Frameworks
>       (Prashant R. Naik)
>    7. [Ticket #18] Another qn. THanks for the basic of basic qn\
>       (Prashant R. Naik)
>    8. [Ticket #29] Another qn. THanks for the basic of basic qn\
>       (Prashant R. Naik)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 8 May 2013 23:00:40 +0530
> From: "Jagadeesh N. Malakannavar" <mnjagadeesh at gmail.com>
> To: bangpypers at python.org
> Subject: Re: [BangPypers] Another qn. THanks for the basic of basic
>         qn\
> Message-ID:
>         <
> CA+LofSnd_amqAOPSxn31SsPFWdCLoJ8TUAb7o8Q82R1XJnTbqw at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I prefer to do it like this
>
> >>> a = list(str(3245325))
> >>> sum(map(int, a))
> 24
> >>>
>
> --
>
> Thanks,
> Jagadeesh N.Malakannavar
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 8 May 2013 23:37:11 +0530
> From: Gora Mohanty <gora at mimirtech.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] Another qn. THanks for the basic of basic
>         qn\
> Message-ID:
>         <
> CACiMRG+PkONBEBv6R5HTydpXREs7N19E57MV_EGwkWOrvNYidg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 8 May 2013 23:00, Jagadeesh N. Malakannavar <mnjagadeesh at gmail.com>
> wrote:
> > I prefer to do it like this
> >
> >>>> a = list(str(3245325))
> >>>> sum(map(int, a))
> > 24
>
> What does the map() gain you over basic list comprehension:
>    sum( [int(i) for i in '3245325'] )
> ignoring any try/catch for int conversion errors
>
> IMHO, this is easier to understand, more Pythonic, and likely
> faster.
>
> Regards,
> Gora
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 09 May 2013 07:32:03 +0530
> From: Noufal Ibrahim <noufal at nibrahim.net.in>
> To: Gora Mohanty <gora at mimirtech.com>
> Cc: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] Another qn. THanks for the basic of basic
>         qn\
> Message-ID: <87wqr8lxlw.fsf at sanitarium.localdomain>
> Content-Type: text/plain
>
> Gora Mohanty <gora at mimirtech.com> writes:
>
> > On 8 May 2013 23:00, Jagadeesh N. Malakannavar <mnjagadeesh at gmail.com>
> wrote:
> >> I prefer to do it like this
> >>
> >>>>> a = list(str(3245325))
> >>>>> sum(map(int, a))
> >> 24
> >
> > What does the map() gain you over basic list comprehension:
> >    sum( [int(i) for i in '3245325'] )
>
> You could drop the []. No need to first generate and then iterate over
> the list.
>
> [...]
>
>
> --
> Cordially,
> Noufal
> http://nibrahim.net.in
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 9 May 2013 08:36:16 +0530
> From: Sriram Narayanan <sriramnrn at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: [BangPypers] A Comparison of Mocking Frameworks
> Message-ID:
>         <
> CANiY96aZdbMWirgYjW6LfiNmT0h-bweyGQui4kdyh++mn4VLbA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi everyone:
>
> A colleague pointed me to this comparison of mocking frameworks:
> http://garybernhardt.github.io/python-mock-comparison/
>
> -- Sriram
> ------------------------------------
> Belenix: www.belenix.org
> Twitter: @sriramnrn
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 9 May 2013 10:42:34 +0530
> From: Gora Mohanty <gora at mimirtech.com>
> To: Noufal Ibrahim <noufal at nibrahim.net.in>
> Cc: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] Another qn. THanks for the basic of basic
>         qn\
> Message-ID:
>         <
> CACiMRGLmAJ5_o6wYXyBa62ACmYmtM8WyD55sK3ZcQWSVEvabdw at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 9 May 2013 07:32, Noufal Ibrahim <noufal at nibrahim.net.in> wrote:
> > Gora Mohanty <gora at mimirtech.com> writes:
> >
> >> On 8 May 2013 23:00, Jagadeesh N. Malakannavar <mnjagadeesh at gmail.com>
> wrote:
> >>> I prefer to do it like this
> >>>
> >>>>>> a = list(str(3245325))
> >>>>>> sum(map(int, a))
> >>> 24
> >>
> >> What does the map() gain you over basic list comprehension:
> >>    sum( [int(i) for i in '3245325'] )
> >
> > You could drop the []. No need to first generate and then iterate over
> > the list.
>
> Ah, yes! Forgot that the expression would act as a generator.
> Good catch!
>
> Regards,
> Gora
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 9 May 2013 08:22:00 +0000
> From: "Prashant R. Naik" <prashant at triconinfotech.com>
> To: "bangpypers at python.org" <bangpypers at python.org>
> Subject: [BangPypers] [Ticket #27]  A Comparison of Mocking Frameworks
> Message-ID:
>         <E728B7F635D6814A9049AC1C56B08D0C473F0CE9 at MAIL.triconhome.local>
> Content-Type: text/plain; charset="us-ascii"
>
> On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=
> triconinfotech.com at python.org wrote:
>
> Hi everyone:
>
> A colleague pointed me to this comparison of mocking frameworks:
> http://garybernhardt.github.io/python-mock-comparison/
>
> -- Sriram
> ------------------------------------
> Belenix: www.belenix.org
> Twitter: @sriramnrn
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
> ________________________________
> This is an automated response. Your issue has been noted. We'll be in
> touch soon.
>
> Please reply to this email or visit the URL below with any additional
> details.
>
> http://DB01:9675/portal/view-help-request/27
>
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 9 May 2013 08:20:58 +0000
> From: "Prashant R. Naik" <prashant at triconinfotech.com>
> To: "bangpypers at python.org" <bangpypers at python.org>
> Subject: [BangPypers] [Ticket #18] Another qn. THanks for the basic of
>         basic qn\
> Message-ID:
>         <E728B7F635D6814A9049AC1C56B08D0C473F0AC8 at MAIL.triconhome.local>
> Content-Type: text/plain; charset="us-ascii"
>
> On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=
> triconinfotech.com at python.org wrote:
>
> On 9 May 2013 07:32, Noufal Ibrahim <noufal at nibrahim.net.in> wrote:
> > Gora Mohanty <gora at mimirtech.com> writes:
> >
> >> On 8 May 2013 23:00, Jagadeesh N. Malakannavar <mnjagadeesh at gmail.com>
> wrote:
> >>> I prefer to do it like this
> >>>
> >>>>>> a = list(str(3245325))
> >>>>>> sum(map(int, a))
> >>> 24
> >>
> >> What does the map() gain you over basic list comprehension:
> >> sum( [int(i) for i in '3245325'] )
> >
> > You could drop the []. No need to first generate and then iterate over
> > the list.
>
> Ah, yes! Forgot that the expression would act as a generator.
> Good catch!
>
> Regards,
> Gora
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
> ________________________________
> This is an automated response. Your issue has been noted. We'll be in
> touch soon.
>
> Please reply to this email or visit the URL below with any additional
> details.
>
> http://DB01:9675/portal/view-help-request/18
>
>
>
> ------------------------------
>
> Message: 8
> Date: Thu, 9 May 2013 08:22:47 +0000
> From: "Prashant R. Naik" <prashant at triconinfotech.com>
> To: "bangpypers at python.org" <bangpypers at python.org>
> Subject: [BangPypers] [Ticket #29] Another qn. THanks for the basic of
>         basic qn\
> Message-ID:
>         <E728B7F635D6814A9049AC1C56B08D0C473F0DDF at MAIL.triconhome.local>
> Content-Type: text/plain; charset="us-ascii"
>
> On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=
> triconinfotech.com at python.org wrote:
>
> Gora Mohanty <gora at mimirtech.com> writes:
>
> > On 8 May 2013 23:00, Jagadeesh N. Malakannavar <mnjagadeesh at gmail.com>
> wrote:
> >> I prefer to do it like this
> >>
> >>>>> a = list(str(3245325))
> >>>>> sum(map(int, a))
> >> 24
> >
> > What does the map() gain you over basic list comprehension:
> > sum( [int(i) for i in '3245325'] )
>
> You could drop the []. No need to first generate and then iterate over
> the list.
>
> [...]
>
>
> --
> Cordially,
> Noufal
> http://nibrahim.net.in
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
> ________________________________
> This is an automated response. Your issue has been noted. We'll be in
> touch soon.
>
> Please reply to this email or visit the URL below with any additional
> details.
>
> http://DB01:9675/portal/view-help-request/29
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
>
> ------------------------------
>
> End of BangPypers Digest, Vol 69, Issue 7
> *****************************************
>



-- 

Thanks,
Jagadeesh N.Malakannavar


More information about the BangPypers mailing list