Re: A question on modification of a list via a function invocation

2017-09-07 Thread Rustom Mody
On Thursday, September 7, 2017 at 6:52:04 PM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > > I said: In that case please restate the definition of 'is' from the manual > > which > > invokes the notion of 'memory' without bringing in memory. > > I don't k

Re: Why do we nned both - __init__() and __new__()

2017-09-07 Thread Rustom Mody
On Thursday, September 7, 2017 at 4:27:48 PM UTC+5:30, Andrej Viktorovich wrote: > Hello > > For my understanding both - __init__() and __new__() works like constructors. > And __new__() looks is closer to constructor. __init__() is more for variable > initialization. Why I can't just

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 5:48:48 PM UTC+5:30, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: > > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano > > wrote: > >> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote:

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 4:03:40 PM UTC+5:30, ROGER GRAYDON CHRISTMAN wrote: > On 5 Sep 2017 14:28:44, (Dennis Lee Bier) wrote: > > On 5 Sep 2017 17:57:18 GMT, > >> But what does "a C++ reference" refer to? > >> > > > Per Stroustrup (The C++ Programming Language 4th Ed, page 189)

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: > On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: > > > > Can you explain what "id" and "is" without talking of memory? > > Yes. > > id() returns an abstract

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 10:45:45 PM UTC+5:30, Ned Batchelder wrote: > On 9/5/17 1:02 PM, Steve D'Aprano wrote: > > On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: > > > >> Dennis Lee Bieber wrote: > >>> Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference > >>>

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 7:32:52 PM UTC+5:30, Chris Angelico wrote: > On Tue, Sep 5, 2017 at 11:49 PM, Rustom Mody wrote: > > Pop et al wont work with frozen sets > > Containment wont work with sets — what mathematicians call 'not closed' > > All of which amounts to

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 6:59:11 PM UTC+5:30, Ben Bacarisse wrote: > Rustom Mody writes: > > > On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote: > >> Rustom Mody writes: > >> > >> > Here is some code

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-04 Thread Rustom Mody
On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote: > Rustom Mody writes: > > > Here is some code I (tried) to write in class the other day > > > > The basic problem is of generating combinations > > > Now thats neat as far as it goes b

Please improve these comprehensions (was meaning of [ ])

2017-09-04 Thread Rustom Mody
Since these discussions are uselessly abstract and meta Here is some code I (tried) to write in class the other day The basic problem is of generating combinations Using the pascal-identity nCr + nC(r-1) = (n+1)Cr This can be written (Haskell) c :: Int -> Int -> Int c n 0 = 1 c 0 (r+1)

Re: meaning of [ ]

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 10:42:47 PM UTC+5:30, Rick Johnson wrote: > On Monday, September 4, 2017 at 9:27:23 AM UTC-5, Rustom Mody wrote: > > On Monday, September 4, 2017 at 6:36:11 PM UTC+5:30, Ben Bacarisse wrote: > > > Rustom Mody writes: > > > > > >

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 9:13:43 PM UTC+5:30, Steve D'Aprano wrote: > On Tue, 5 Sep 2017 01:17 am, Rustom Mody wrote: > > > Anton gave a picture explaining why/how references are needed and to be > > understood > > Antoon gave a picture demonstrating one mod

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 8:37:45 PM UTC+5:30, Steve D'Aprano wrote: > On Tue, 5 Sep 2017 12:34 am, Rustom Mody wrote: > > > On Monday, September 4, 2017 at 5:58:18 PM UTC+5:30, ROGER GRAYDON CHRISTMAN > > wrote: > >> Or with just one function: >>> def ba

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 7:50:39 PM UTC+5:30, Steve D'Aprano wrote: > On Mon, 4 Sep 2017 01:11 pm, Rustom Mody wrote: > > Simply put: pythonistas have no coherent/consistent sense of what python > > values are. And the endless parameter-passing-nomenclature argument

Re: meaning of [ ]

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 7:57:23 PM UTC+5:30, Rustom Mody wrote: > On Monday, September 4, 2017 at 6:36:11 PM UTC+5:30, Ben Bacarisse wrote: > > But [p for p in sys.path] is a list and "set-builder" notation is used > > for sets. Order is crucial for sys.path. Y

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 5:58:18 PM UTC+5:30, ROGER GRAYDON CHRISTMAN wrote: > >Does a poor job AFAIAC of explaining the difference between foo and bar in > foll def foo(x): x += 2 > def bar(x): x.append(2) > a=10 > b=[10] > foo(a) > a > >10 > bar(b) >

Re: meaning of [ ]

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 6:36:11 PM UTC+5:30, Ben Bacarisse wrote: > Rustom Mody writes: > > > On Sunday, September 3, 2017 at 5:10:13 PM UTC+5:30, Rick Johnson wrote: > >> Andrej Viktorovich wrote: > >> > I suppose p becomes array of strings bu

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 3:35:54 PM UTC+5:30, Antoon Pardon wrote: > Op 04-09-17 om 00:44 schreef Dennis Lee Bieber: > > And is a limited theoretical study, heavy in mathematics and light in > > implementation. > > > > Programming Languages: Design and Implementation (Terrence W

Re: A question on modification of a list via a function invocation

2017-09-04 Thread Rustom Mody
On Monday, September 4, 2017 at 1:46:55 PM UTC+5:30, Gregory Ewing wrote: > Stefan Ram wrote: > > JavaScript and Python do not have references as values > > Yes, they do. The difference is that they don't have any > way of *not* having references as values, so there's less > need to use the

Re: meaning of [ ]

2017-09-03 Thread Rustom Mody
On Sunday, September 3, 2017 at 5:10:13 PM UTC+5:30, Rick Johnson wrote: > Andrej Viktorovich wrote: > > I suppose p becomes array of strings but what [] means in this statement? > > Generally, it's an inline form of writing a loop that returns a list. There > are other types as well. Tsk tsk

Re: A question on modification of a list via a function invocation

2017-09-03 Thread Rustom Mody
On Monday, September 4, 2017 at 7:50:22 AM UTC+5:30, Chris Angelico wrote: > On Mon, Sep 4, 2017 at 12:05 PM, Steve D'Aprano wrote: > > On Mon, 4 Sep 2017 04:15 am, Stephan Houben wrote: > > > >> Needless to say, according to the definition in Plotkin's paper, Python > >> is "call-by-value". > > >

Re: Reading the documentation

2017-08-25 Thread Rustom Mody
On Friday, August 25, 2017 at 11:23:26 PM UTC+5:30, MRAB wrote: > On 2017-08-25 15:40, Dennis Lee Bieber wrote: > > On Thu, 24 Aug 2017 21:47:41 -0700 (PDT), Rustom Mody declaimed the > > following: > > > > > >>This was true of Britain 100 years ago &g

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 10:18:07 AM UTC+5:30, Rustom Mody wrote: > On Friday, August 25, 2017 at 9:09:16 AM UTC+5:30, larry@gmail.com wrote: > > On Thu, Aug 24, 2017 at 11:27 PM, Rustom Mody wrote: > > > Chomsky is in the Turing bracket, I wonder where Larry falls wrt

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 9:09:16 AM UTC+5:30, larry@gmail.com wrote: > On Thu, Aug 24, 2017 at 11:27 PM, Rustom Mody wrote: > > Chomsky is in the Turing bracket, I wonder where Larry falls wrt CS > > I have a degree in Software Engineering from Rochester Institute of

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 9:58:15 AM UTC+5:30, Chris Angelico wrote: > On Fri, Aug 25, 2017 at 1:23 PM, Rustom Mody wrote: > > Early in my python classes I show this: > > > > $ python > > Python 2.7.13 (default, Jan 19 2017, 14:48:08) > > [GCC 6.3.0 2

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 9:06:53 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 25 Aug 2017 01:27 pm, Rustom Mody wrote: > > > People should be free to dislike who they like to dislike > > However… > > Calling Newton an idiot is ok… if you are not a physicist (fla

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 8:52:11 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 25 Aug 2017 12:47 pm, Larry Martell wrote: > > > On Thu, Aug 24, 2017 at 9:21 PM Rustom Mody wrote: > > > >> Statement 1: Aeroplanes fly > >> Statement 2: Submarines swim >

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 8:39:25 AM UTC+5:30, Rustom Mody wrote: > On Friday, August 25, 2017 at 8:28:55 AM UTC+5:30, Ian wrote: > > On Aug 24, 2017 8:51 PM, "Larry Martell" wrote: > > > > On Thu, Aug 24, 2017 at 9:21 PM Rustom Mody wrote: > &g

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 8:28:55 AM UTC+5:30, Ian wrote: > On Aug 24, 2017 8:51 PM, "Larry Martell" wrote: > > On Thu, Aug 24, 2017 at 9:21 PM Rustom Mody wrote: > > > Statement 1: Aeroplanes fly > > Statement 2: Submarines swim > > > > &

Re: Reading the documentation

2017-08-24 Thread Rustom Mody
On Friday, August 25, 2017 at 6:55:46 AM UTC+5:30, Ben Bacarisse wrote: > Steve D'Aprano writes: > > > On Fri, 25 Aug 2017 09:41 am, bob gailer wrote: > > > >>> Help on built-in function floor in module math: > >>> > >>> floor(...) > >>> floor(x) > >>> > >>> Return the floor of x as an

Re: Proposed new syntax

2017-08-22 Thread Rustom Mody
Since this erm… discussion has also brought in Haskell and in this case, the name, the history etc are related I thought I'd mention the following Around 2015 there was a major upheaval in the Haskell community around the socalled FTP (foldable-traversable-prelude) controversy. In many respects

Re: Proposed new syntax

2017-08-21 Thread Rustom Mody
On Sunday, August 20, 2017 at 11:00:22 AM UTC+5:30, Paul Rubin wrote: > Rustom Mody writes: > > Specifically the term 'comprehension' used today as a programming construct > > traces somewhat tenuously to an axiom that Zermelo/Fraenkel formulated > > in the 1920s > > I

Re: Proposed new syntax

2017-08-19 Thread Rustom Mody
On Saturday, August 19, 2017 at 9:45:48 AM UTC+5:30, Steve D'Aprano wrote: > On Sat, 19 Aug 2017 12:59 am, Chris Angelico wrote: > > > On Fri, Aug 18, 2017 at 11:46 PM, Rustom Mody wrote: > >> Compare the well-known haskell tutorial > >> http://learnyouahaske

Re: Proposed new syntax

2017-08-18 Thread Rustom Mody
There is code and there are machines There are Turing machines and Universal Turing machines There are programs and there are programming languages There are (il)legal programs and best/worst (software engineering) practices As best as I can see most of us are talking of the respective latters

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Rustom Mody
On Friday, August 18, 2017 at 8:37:43 AM UTC+5:30, Steve D'Aprano wrote: > On Thu, 17 Aug 2017 11:19 pm, Rustom Mody wrote: > > > What is called ‘call-by-object’ or ‘call-by-sharing’ etc is really an > > acknowledgement of the fact that parameter passing in

Re: Proposed new syntax

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 8:13:24 PM UTC+5:30, Marko Rauhamaa wrote: > Gregory Ewing : > > I don't agree that the word "for" necessarily implies proceduralness. > > Programming languages stole the word from math, where it is > nonprocedural. > > Really, "for" is just a preposition. In

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 6:49:19 AM UTC+5:30, Mok-Kong Shen wrote: > Am 17.08.2017 um 02:41 schrieb Steve D'Aprano: > > On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: > > > >> I have earlier learned some other (older) programming languages. For > >> these the formal parameters are

Re: Proposed new syntax

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 5:51:45 PM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > If he wanted declarative semantics, why didn't he argue for declarative > > syntax > > like "select...where", instead of choosing procedural syntax which matches > > the > > actual procedural

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Rustom Mody
On Wednesday, August 16, 2017 at 8:24:46 PM UTC+5:30, Steve D'Aprano wrote: > Over in another thread, we've been talking about comprehensions and their > similarities and differences from the functional map() operation. > > Reminder: > > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B',

Re: Proposed new syntax

2017-08-15 Thread Rustom Mody
On Tuesday, August 15, 2017 at 5:48:43 PM UTC+5:30, Steve D'Aprano wrote: > On Tue, 15 Aug 2017 02:54 pm, Rustom Mody wrote: > > > On Monday, August 14, 2017 at 10:35:22 PM UTC+5:30, Terry Reedy wrote: > [...] > >> Suppose stdin contains "a\nb\nc\nd\ne\nf\ng

Re: Proposed new syntax

2017-08-14 Thread Rustom Mody
On Monday, August 14, 2017 at 10:35:22 PM UTC+5:30, Terry Reedy wrote: > On 8/14/2017 5:59 AM, Ben Finney wrote: > > > At what point will you accept the feedback: That the comprehension > > syntax *does not* necessarily connote a procedural loop, but instead can > > quite reasonably be

Re: Proposed new syntax

2017-08-14 Thread Rustom Mody
On Tuesday, August 15, 2017 at 3:57:22 AM UTC+5:30, Gregory Ewing wrote: > Ben Finney wrote: > > That the comprehension > > syntax *does not* necessarily connote a procedural loop, but instead can > > quite reasonably be interpreted as its designer intended, a single > > conceptual operation. > >

Re: Proposed new syntax

2017-08-14 Thread Rustom Mody
http://www.cosc.canterbury.ac.nz/greg.ewing/python/listcomp/ Greg's 1999 announcement. If you see the "semantics are equivalent" Steven wins. If you focus on "like other languages" then it's... well not quite equivalent! We can take our pick! For myself, as I earlier said, if python disagrees

Re: Proposed new syntax

2017-08-14 Thread Rustom Mody
On Monday, August 14, 2017 at 3:30:39 PM UTC+5:30, Ben Finney wrote: > Steven D'Aprano writes: > > > On Sun, 13 Aug 2017 21:06:08 -0700, Rustom Mody wrote: > > > > > Here's a bunch of different ways in which a mapping comprehension > > > could be implemented:

Re: Proposed new syntax

2017-08-13 Thread Rustom Mody
On Monday, August 14, 2017 at 4:26:06 AM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > > Python's comprehensions are inspired by Haskell's, but we made different > > choices > > than they did: we make the fact that a comprehension is a loop over values > > explicit, rather than

Re: data ecosystem

2017-08-13 Thread Rustom Mody
On Sunday, August 13, 2017 at 6:04:42 AM UTC+5:30, Man with No Name wrote: > So > > I've an idea to make use of python's unique environment (>>>) to form a > peer-to-peer object-sharing ecosystem. > > Just pie-in-the-sky brainstorming... > > When a programmer (or object-user) starts up the

Re: Proposed new syntax

2017-08-12 Thread Rustom Mody
On Saturday, August 12, 2017 at 5:25:43 PM UTC+5:30, Peter Otten wrote: > Rustom Mody wrote: > > > [ My conjecture: The word ‘comprehension’ used this way in English is > > meaningless and is probably an infelicious translation of something which > > makes sense in

Re: Proposed new syntax

2017-08-11 Thread Rustom Mody
On Friday, August 11, 2017 at 8:33:32 PM UTC+5:30, Ian wrote: > The grand-daddy of them all, NPL (which actually called them "set > comprehensions" after mathematics): > > setofeven(X) <= <:x: x in X & even(x) :> Thanks for reminding of NPL; will add it to my history summary at

Re: Code for addition

2017-08-04 Thread Rustom Mody
On Saturday, August 5, 2017 at 6:55:09 AM UTC+5:30, Steve D'Aprano wrote: > On Sat, 5 Aug 2017 12:43 pm, Ode Idoko wrote: > > > Can anyone help with the python code that can add 101, 102, 103...2033 > > please? > > > Sounds like homework. Here are some hints for you to play around with and see

Re: Falsey Enums

2017-07-28 Thread Rustom Mody
On Friday, July 28, 2017 at 1:45:46 PM UTC+5:30, Ben Finney wrote: > Ethan Furman writes: > > > class X(Enum): > > Falsey = 0 > > Truthy = 1 > > Fakey = 2 > > def __bool__(self): > > return bool(self.value) > > I am surprised this is not already the behaviour of an Enum

Falsey Enums

2017-07-27 Thread Rustom Mody
Isn't dunder-bool what you want? (dunder-nonzero in python2) Dunno if special caveats for Enums PS sorry for phone-post -- I've broken my leg -- https://mail.python.org/mailman/listinfo/python-list

Re: I am new here and i need your help please

2017-07-26 Thread Rustom Mody
On Wednesday, July 26, 2017 at 12:11:27 PM UTC+5:30, dieter wrote: > yasirrbadamasi: > > > I have never execute any program before using python and a task was given > > to me by my teacher > > I suggest to start by reading the Python tutorial: > "https://docs.python.org/3/tutorial/index.html;.

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread Rustom Mody
On Tuesday, July 25, 2017 at 12:04:45 PM UTC+5:30, Ben Finney wrote: > Ethan Furman writes: > > > Something like: > > > > try: > > > > except ZeroDivisionError as dead_exc: > > exc = dead_exc > > > > > > print(text_template.format(exc=exc) >

Recent Spam problem

2017-07-24 Thread Rustom Mody
Of late there has been an explosion of spam Thought it was only a google-groups (USENET?) issue and would be barred from the mailing list. But then find its there in the mailing list archives as well Typical example: https://mail.python.org/pipermail/python-list/2017-July/724085.html What

Re: Python 3 removes name binding from outer scope

2017-07-24 Thread Rustom Mody
On Tuesday, July 25, 2017 at 7:12:44 AM UTC+5:30, Ben Finney quoted Thomas Jefferson's : > The cost of education is trivial compared to the cost of ignorance. An interesting standard of “trivial”… given… UK has risen to more than £100 billion for the first time

Re: Grapheme clusters, a.k.a.real characters

2017-07-20 Thread Rustom Mody
On Thursday, July 20, 2017 at 3:21:52 AM UTC+5:30, Rick Johnson wrote: > On Tuesday, July 18, 2017 at 10:07:41 PM UTC-5, Steve D'Aprano wrote: > > On Wed, 19 Jul 2017 12:10 am, Rustom Mody wrote: > > [...] > > > > Einstein: If you can't explain something to a six-

Re: Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Rustom Mody
On Wednesday, July 19, 2017 at 3:00:21 AM UTC+5:30, Marko Rauhamaa wrote: > Chris Angelico : > > > Let me give you one concrete example: the letter "ö". In English, it > > is (very occasionally) used to indicate diaeresis, where a pair of > > letters is not a double letter - for example,

Re: Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Rustom Mody
On Monday, July 17, 2017 at 10:14:00 PM UTC+5:30, Rhodri James wrote: > On 17/07/17 05:10, Rustom Mody wrote: > > Hint1: Ask your grandmother whether unicode's notion of character makes > > sense. > > Ask 10 gmas from 10 language-L's > > Hint2: When in doubt gma usual

Re: Grapheme clusters, a.k.a.real characters

2017-07-17 Thread Rustom Mody
On Monday, July 17, 2017 at 9:41:51 AM UTC+5:30, Rustom Mody wrote: > On a more serious note every other post on this (as on many discussing unicode > more broadly) is so ridiculously Euro (or Anglo) centric I would not know > where > to begin. > Witness your own… &g

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rustom Mody
On Monday, July 17, 2017 at 6:58:57 AM UTC+5:30, Steve D'Aprano wrote: > On Mon, 17 Jul 2017 01:40 am, Rustom Mody wrote: > > > On Sunday, July 16, 2017 at 8:10:41 PM UTC+5:30, Rick Johnson wrote: > [...] > > $ python > > Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (def

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rustom Mody
On Sunday, July 16, 2017 at 8:10:41 PM UTC+5:30, Rick Johnson wrote: > On Sunday, July 16, 2017 at 2:55:57 AM UTC-5, Marko Rauhamaa wrote: > > Mikhail V : > > > On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > > > > > > > > Random access to code points is as uninteresting as > > > > random

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rustom Mody
The first book I studied as a CS-student was Structured Computer Organization by Tanenbaum Apart from the detailed description of various machines like PDP-11, IBM-360 etc it suggested the understanding of the computer at 4 levels: - Microprogramming level - "Conventional" machine level

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rustom Mody
On Sunday, July 16, 2017 at 4:09:16 AM UTC+5:30, Mikhail V wrote: > On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > > Random access to code points is as uninteresting as random access to > > UTF-8 bytes. > > I might want random access to the "Grapheme clusters, a.k.a.real > > characters". >

Re: Write this accumuator in a functional style

2017-07-13 Thread Rustom Mody
Pavol Lisy wrote: > IMHO problem is doubling size for huge lists. > Or waste big memory for huge frozensets. I mean resize it to 2*N if > its size is just N+1. Couple that with the fact that space-time are not unrelated on any modern VM based OS + cache based hw. Doubly so for "managed"

Re: Write this accumuator in a functional style

2017-07-13 Thread Rustom Mody
Marko wrote: > Simple, yes, but is the worst case > insertion/deletion time still within > O(log n)? Good point; and needs to be applied to Steven's append-using OP as well Yeah I know append method is supposedly O(1). I find that surprising... More so when the article

Re: Write this accumuator in a functional style

2017-07-12 Thread Rustom Mody
On Tuesday, July 11, 2017 at 4:11:50 PM UTC+5:30, Alain Ketterlin wrote: > Steven D'Aprano writes: > > > I have a colleague who is allergic to mutating data structures. Yeah, I > > know, he needs to just HTFU but I thought I'd humour him. > > > > Suppose I have an iterator that yields named

Re: Teaching the "range" function in Python 3

2017-06-29 Thread Rustom Mody
On Friday, June 30, 2017 at 8:28:23 AM UTC+5:30, Chris Angelico wrote: > On Fri, Jun 30, 2017 at 12:33 PM, Rick Johnson wrote: > > A better *FIRST* example would be > > something like this: > > > > def add(x, y): > > return x + y > > > > When teaching a student about functions, the

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Rustom Mody
On Wednesday, June 28, 2017 at 1:04:46 AM UTC+5:30, Marko Rauhamaa wrote: > John Ladasky > > OK, that's cheating a bit, using Numpy. It's a nice little program, > > but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a library would be > dead. One

Re: Syntax error for simple script

2017-06-26 Thread Rustom Mody
On Monday, June 26, 2017 at 10:11:46 PM UTC+5:30, rurpy wrote: > How about: «suggested error message» > Or better than changing the message, how about leaving it alone and > simply responding helpfully… Since everyone seems to only have read the first suggestion from rurpy, let me ask,

Re: Progress on the Gilectomy

2017-06-22 Thread Rustom Mody
On Thursday, June 22, 2017 at 4:28:03 AM UTC+5:30, Steve D'Aprano wrote: > On Thu, 22 Jun 2017 08:23 am, breamoreboy wrote: > > > Don't you know that Lawrence D’Oliveiro has been banned from the mailing > > list > > as he hasn't got a clue what he's talking about, > > That's not why he was

Re: Progress on the Gilectomy

2017-06-19 Thread Rustom Mody
On Tuesday, June 20, 2017 at 5:53:00 AM UTC+5:30, Cem Karan wrote: > On Jun 19, 2017, at 6:19 PM, Gregory Ewing wrote: > > > Ethan Furman wrote: > >> Let me ask a different question: How much effort is required at the C > >> level when using tracing garbage collection? > > > > That depends on

Re: Progress on the Gilectomy

2017-06-19 Thread Rustom Mody
On Monday, June 19, 2017 at 7:40:49 PM UTC+5:30, Robin Becker wrote: > On 19/06/2017 01:20, Paul Rubin wrote: > ... > > the existing C API quite seriously. Reworking the C modules in the > > stdlib would be a large but not impossible undertaking. The many > > external C modules out there

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Rustom Mody
On Sunday, June 4, 2017 at 12:45:23 AM UTC+5:30, Jon Forrest wrote: > I'm learning about Python. A book I'm reading about it > says "... a string in Python is a sequence. A sequence is an ordered > collection of objects". This implies that each character in a string > is itself an object. > >

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 7:11:50 PM UTC+5:30, Chris Angelico wrote: > On Fri, May 26, 2017 at 10:52 PM, Rustom Mody wrote: > >> Can you explain to me how it's different? Either way, the > >> implementation is allowed to do what it likes, because you shouldn't > >&g

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:31:54 PM UTC+5:30, Chris Angelico wrote: > On Fri, May 26, 2017 at 9:46 PM, Steve D'Aprano wrote: > > > >> And yes, Steve, this is a challenge to you: if you think C's undefined > >> behaviour is an abomination that should not be allowed to exist, > > > > CPython

Re: Check for regular expression in a list

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:55:32 PM UTC+5:30, Jussi Piitulainen wrote: > Rustom Mody writes: > > > On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: > >> To check if Firefox is running I use: > >> if not 'firefox' in [i.nam

Re: Check for regular expression in a list

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: > To check if Firefox is running I use: > if not 'firefox' in [i.name() for i in list(process_iter())]: > > It probably could be made more efficient, because it can stop when it > finds the first instance. > > But know I

Re: Top Python Interview Questions

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 12:28:30 PM UTC+5:30, Steve D'Aprano wrote: > On Fri, 26 May 2017 03:32 pm, Terry Reedy wrote: > > >> Python files are compiled to bytecode. > > > > CPython compiles to cpython bytecode. > > Jython compiles to Java. > > Iron Python compiles to C#. > > Technically,

Re: Scala considering significant indentation like Python

2017-05-25 Thread Rustom Mody
On Wednesday, May 24, 2017 at 8:01:53 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > > Grant Edwards grant.b.edwards writes: > > > > > On 2017-05-23, Michael Torrie wrote: > > > > Sometimes things

Re: Scala considering significant indentation like Python

2017-05-24 Thread Rustom Mody
On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > Grant Edwards grant.b.edwards writes: > > > On 2017-05-23, Michael Torrie wrote: > > > Sometimes things get longer than a page (like a class definition). > > > > A nice folding mode works nicely for that sort of thing. I

OT footers (was Rosetta: )

2017-05-14 Thread Rustom Mody
On Monday, May 15, 2017 at 1:23:41 AM UTC+5:30, breamerboy wrote: > On Sunday, May 14, 2017 at 2:44:33 AM UTC+1, Steve D'Aprano wrote: > > On Sun, 14 May 2017 07:03 am, Jan van den Broek wrote: > > > > > On 2017-05-13, Robert L. < wrote: > > > > > > [Schnipp] > > > > > >> def build_permutations

Re: Ten awesome things you are missing out on if you're still using Python 2

2017-05-10 Thread Rustom Mody
On Tuesday, May 9, 2017 at 8:16:09 PM UTC+5:30, Serhiy Storchaka wrote: > On 09.05.17 09:01, Rustom Mody wrote: > > On Monday, May 8, 2017 at 12:48:03 PM UTC+5:30, Steven D'Aprano wrote: > >> http://www.asmeurer.com/python3-presentation/slides.html#1 > > > > Nice li

Re: Ten awesome things you are missing out on if you're still using Python 2

2017-05-09 Thread Rustom Mody
On Monday, May 8, 2017 at 12:48:03 PM UTC+5:30, Steven D'Aprano wrote: > http://www.asmeurer.com/python3-presentation/slides.html#1 Nice list thanks! Do you have a similar list of 10 awesome features of Python that you can't use because you refuse to upgrade from Java/C++ ? [Context: Ive to

Re: I want to learn Python and how to benefit from the great Data Science packages - have some questions.

2017-05-08 Thread Rustom Mody
On Sunday, May 7, 2017 at 1:03:57 AM UTC+5:30, Rahim Shamsy wrote: > Hi, > > Hope you are well. I am currently in the process of learning the basics of > programming in Python, and was just checking if I am in the right direction. The tutorial https://docs.python.org/3/tutorial/ is short and

Re: Bigotry (you win, I give up)

2017-04-27 Thread Rustom Mody
On Friday, April 28, 2017 at 9:36:02 AM UTC+5:30, Mike Reveile wrote: > On Wednesday, April 19, 2017 at 9:44:15 AM UTC-7, Rurpy wrote: > > On 04/18/2017 04:34 PM, Chris Angelico wrote: > > > On Wed, Apr 19, 2017 at 8:28 AM, Ben Finney wrote: > > >> Chris Angelico writes: > > >> > <> > >

Re: Bigotry (you win, I give up)

2017-04-27 Thread Rustom Mody
On Friday, April 28, 2017 at 9:36:02 AM UTC+5:30, Mike Reveile wrote: > On Wednesday, April 19, 2017 at 9:44:15 AM UTC-7, Rurpy wrote: > > On 04/18/2017 04:34 PM, Chris Angelico wrote: > > > On Wed, Apr 19, 2017 at 8:28 AM, Ben Finney wrote: > > >> Chris Angelico writes: > > >> > <> > >

Re: Bigotry (you win, I give up)

2017-04-25 Thread Rustom Mody
On Monday, April 24, 2017 at 1:20:05 PM UTC+5:30, Antoon Pardon wrote: > Op 22-04-17 om 13:17 schreef Rustom Mody: > > On Friday, April 21, 2017 at 2:38:08 PM UTC+5:30, Antoon Pardon wrote: > >> Op 20-04-17 om 17:25 schreef Rustom Mody: > >>> But more importa

Re: Bigotry (you win, I give up)

2017-04-22 Thread Rustom Mody
On Friday, April 21, 2017 at 2:38:08 PM UTC+5:30, Antoon Pardon wrote: > Op 20-04-17 om 17:25 schreef Rustom Mody: > > But more importantly thank you for your polite and consistent pointing out > > to > > Ben Finney that his religion-bashing signature lines [many of them

Re: Bigotry (you win, I give up)

2017-04-20 Thread Rustom Mody
On Thursday, April 20, 2017 at 5:11:58 AM UTC+5:30, Ethan Furman wrote: > On 04/19/2017 03:58 PM, Ben Finney wrote: > > Ethan Furman writes: > > > >> […] asking that you be courteous to those who come here to discuss > >> Python. > > > > On that we can agree. Let's be courteous to people here, and

Re: The belief that learning is more difficult for older people (was: Bigotry (you win, I give up))

2017-04-20 Thread Rustom Mody
On Thursday, April 20, 2017 at 7:51:55 AM UTC+5:30, Ben Finney wrote: > "Deborah Swanson" writes: > > > But this bit caught my eye because I hold the opposite opinion about > > old people's ability to learn. > > > > It is a choice. > > The topic is complex, and both “It is entirely determined

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Tuesday, April 18, 2017 at 6:18:06 AM UTC+5:30, Ethan Furman wrote: > On 04/17/2017 03:23 PM, Ben Finney wrote: > > Paul Rubin writes: > >> Rurpy writes: > > >>> A couple weeks ago a frequent poster here (Steve D'Aprano) > >>> called another participant an "ugly american" > >> > >> Oh stop

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Monday, April 17, 2017 at 3:09:44 PM UTC+5:30, Marko Rauhamaa wrote: > Rurpy : > > > If I posted a remark about "dirty Chinese" (c.f. "ugly American") I > > would be (justifiably) slammed and likely ejected from the list. Or if > > claims that not understanding new tech is a product of age are

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Monday, April 17, 2017 at 4:09:34 PM UTC+5:30, Ben Finney wrote: > The charge of bigotry is a strong one here, rightly so, and I think you > for taking it seriously. Will you drop that charge now? If you won't, I > think you need to show how this analysis is incorrect. On the same day that (I

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread Rustom Mody
On Sunday, April 16, 2017 at 7:27:49 PM UTC+5:30, bartc wrote: > Technically, adding this one feature to Python /is/ trivial, ^ You are not paying attention bart and I am not likely to pursue this beyond this post. I tried to say as are others that the substantive reasons to reject a

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread Rustom Mody
On Sunday, April 16, 2017 at 5:36:28 PM UTC+5:30, bartc wrote: > On 16/04/2017 03:51, Steve D'Aprano wrote: > > On Sat, 15 Apr 2017 10:17 pm, bartc wrote: > > >> Yes, I'm constantly surprised at this, as such syntax has a very low > >> cost (in my last compiler, supporting 'while' for example

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:15:11 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 14 Apr 2017 12:52 am, bartc wrote: > > > I know this isn't the Python need-for-speed thread, but this is a > > classic example where the lack of one simple feature leads to using > > slower, more cumbersome ones. >

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:03:24 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 14 Apr 2017 04:09 am, Rustom Mody wrote: > > [Sorry its a vague memory of something I read more than a decade ago that > > [I cant > > trace again] > > Some unknown Cobol progra

Re: Python and the need for speed

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:43:22 AM UTC+5:30, Steve D'Aprano wrote: > On Wed, 12 Apr 2017 07:56 pm, bart wrote: > > > The problem is also the language encouraging people to use high-level but > > inefficient methods, as the emphasis is on productivity and readability** > > rather than

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:14:15 PM UTC+5:30, Steve D'Aprano wrote: > Meyer's "Considered Harmful Essays Considered Harmful" essay is hypocritical > junk, and should be considered harmful. Your view. Here's an alternative. [Sorry its a vague memory of something I read more than a decade

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:19:38 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 11:39 AM, Rustom Mody wrote: > > My broader point (vive la Trump) was that if we learn to actively tolerate > > people with views wildly far from ours, the world would be a better place. >

<    1   2   3   4   5   6   7   8   9   10   >