xml yml and dependency hell

2007-07-10 Thread Rustom Mody
yaml by its indent-orientation is quite pythonic. In comparison xml is cumbersome and laborious. Strangely ruby supports yaml out of the box but python requires a third party package PyYAML. Now this may not seem like a big deal for us -- installing pyYAML takes all of one minute -- but it may n

Re: xml yml and dependency hell

2007-07-10 Thread Rustom Mody
On 7/11/07, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Rustom Mody wrote: > > So is it likely that yaml will make it to the standard python library > > at some point?? > > That's up to the maintainers of PyYAML. If they want to get it in, there will > be ways t

Re: bool behavior in Python 3000?

2007-07-10 Thread Rustom Mody
Considering bools as ints -- Pros: The ALU of any computer uses boolean gates to build an arithmetic functions. Therefore considering the base type of ints and bools to be (strings of) bits seems natural Cons: This comes from the pioneering work of Dijkstra and his coworkers) The distributive law

Re: Can a low-level programmer learn OOP?

2007-07-14 Thread Rustom Mody
On 7/14/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > > OOP can be abused (particularly with deep or intricate inheritance > structures). But the base concept is simple and clear: you can bundle > state and behavior into a stateful "black box" (of which you may make as > many instances, with inde

dejagnu equivalent

2007-07-17 Thread Rustom Mody
Does anyone know if a dejagnu equivalent exists for python? [Dejagnu is in tcl] -- http://mail.python.org/mailman/listinfo/python-list

Re: Copy List

2007-07-18 Thread Rustom Mody
The standard idiom (I guess) is to use the slice >>> a=[1,2,3,4] >>> b=a >>> b is a True >>> b [1, 2, 3, 4] >>> c=a[:] >>> c is a False >>> c [1, 2, 3, 4] This is shallow copy If you want deep copy then from copy import deepcopy -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: exists already

2007-07-18 Thread Rustom Mody
Xah Lee: I agree with what you say now and most of what you wrote a month back -- I even learnt something useful from there -- longlines mode. Emacs is important to me and (I guess) to many of the subscribers here. But how does posting an emacs related question help on a python mailing list?? --

Re: The Modernization of Emacs: exists already

2007-07-18 Thread Rustom Mody
demar Wildenburger <[EMAIL PROTECTED]> wrote: > Rustom Mody wrote: > > But how does posting an emacs related question help on a python mailing > > list?? > > > One Word: Ego. > Don't reply. > > /W > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickled objects over the network

2007-07-18 Thread Rustom Mody
Sure pyro may be the solution but it may also be overkill Why not use safe_load from the yaml module? -- http://mail.python.org/mailman/listinfo/python-list

Pickled objects over the network

2007-07-19 Thread Rustom Mody
Irmen de Jong wrote > In what way would Pyro be overkill where Yaml (also a module that you need > to install separately) wouldn't be? Sure they are the same to install and sure pyro can do the job (pyro is a nice package). But I got the impression that the questioner wanted to do the networking

Re: Pickled objects over the network

2007-07-20 Thread Rustom Mody
ecause we have the networking issues figured out with it, just not the > security problem. So we may end up just sending strings back and forth that > will let us fill out an object's member variables on the other end. It's > much less cool, but it seems like it'd be more s

Re: Pythonic way for missing dict keys

2007-07-20 Thread Rustom Mody
Can someone who knows about python internals throw some light on why >>> x in dic is cheaper than >>> dic.has_key(x) ?? -- http://mail.python.org/mailman/listinfo/python-list

c interfacing in 2.5

2007-09-15 Thread Rustom Mody
I used python extensive 3-5 years back. Coming back I find some changes. Trying to understand whats new and would appreciate any help/comments/pointers. Earlier there were basically two options: SWIG: convenient but inefficient Native (Extending/Embedding): an efficient way of getting a headache

Re: trim start and trailing space chars from string

2007-09-15 Thread Rustom Mody
>>> s=" abcdef " >>> s.strip() 'abcdef' >>> s.rstrip() ' abcdef' >>> s.lstrip() 'abcdef ' >>> On 9/15/07, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote: > Hi, > is there something corresponding to the java String.trim() method, ie > trim start and trailing space/tab chars fro

Re: generating list of sub lists

2007-09-16 Thread Rustom Mody
On 9/16/07, cesco <[EMAIL PROTECTED]> wrote: > Hi, > > is there a one-liner to accomplish the following task? > >From the list > l = ['string1', 'string2', 'string3'] > generate the list of lists > l = [['string1'], ['string1', 'string2'], ['string1', 'string2', > 'string3']] > > Any help would be

Re: can Python be useful as functional?

2007-09-17 Thread Rustom Mody
The following defines the infinite list of primes as a generator [chap 6.5 of the library] def sieve(l): p = l.next() yield p for x in sieve(l): if x % p != 0: yield x After that from itertools import * >>> [p for i,p in izip(range(10), sieve(count(2)))] [2, 3, 5,

Re: can Python be useful as functional?

2007-09-17 Thread Rustom Mody
On 9/18/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > Rustom Mody <[EMAIL PROTECTED]> wrote: > > > Can someone help? Heres the non-working code > > > > def si(l): > > p = l.next() > > yield p > > (x for x in si(l) if x % p != 0) &g

AOP and pep 246

2007-11-01 Thread Rustom Mody
I am interested in AOP in python. From here one naturally (or google-ly) reaches peak. But peak seems to be discontinued. Whereas pep-246 on adaptors seems to be rejected in favor of something else. What?? Can someone please throw some light on whats the current state of the art? -- http://mail

Re: AOP and pep 246

2007-11-01 Thread Rustom Mody
On 11/1/07, Kay Schluehr <[EMAIL PROTECTED]> wrote: > AOP was a research that gone nowhere - at least not in its orginal AspectJ > form: > declaring aspect code that targets business code, weaving the aspect code > into the > business app using a code generator. There was much excitement about

compiling python 3000 on debian etch

2007-11-02 Thread Rustom Mody
Ive been trying to compile python 3000 on debian etch And on running test I get: 4 skips unexpected on linux2: test_tcl test_dbm test_ssl test_bsddb Can someone tell me what packages I am missing? -- http://mail.python.org/mailman/listinfo/python-list

Re: AOP and pep 246

2007-11-02 Thread Rustom Mody
I find these viewpoints interesting in their divergence. At the risk of being simplistic: Kay: AOP == AspectJ or thereabouts. A failure in itself and uninteresting to pythonistas Michele: AOP not very interesting though does good work himself in decorators, metaclasses and other such AOPish stuf

rope python-emacs problem

2008-10-15 Thread Rustom Mody
Ive been trying to use rope for python in emacs and I get a backtrace which starts with AttributeError: 'module' object has no attribute 'samefile' Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
Ben Finney wrote > The key thing to realise is that, having relinquished privilege, the same > process can't get it back again as easily. So if you need to > do some tasks as a privileged user, do those *very* early and then drop the > privileges for the rest of the life of the process. > > Takin

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
On Mon, Mar 30, 2009 at 5:17 PM, andrew cooke wrote: > Rustom Mody wrote: >> Ben Finney wrote >>> The key thing to realise is that, having relinquished privilege, the >>> same process can't get it back again as easily. So if you need to >>> do some t

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
The outline of what I do (in C) is: 1. Write the CGI program in C, put setuid(0), setgid(0) statements in that file and then perform any other actions (including calling other scripts) 2. Set the S bit of the executable of the CGI binary compiled from the C file (chmod +S xxx.cgi) The C code runs

xml in python

2009-05-08 Thread Rustom Mody
Can someone give me a heads up on xml parsing in python? The context is that I want to write a simple docbook to text converter. DOM is alright -- dont want to break my head with SAX just for performance when my documents are not likely to be large. My problem is that there seems to be so many nea

help with recursive whitespace filter in

2009-05-10 Thread Rustom Mody
I am trying to write a recursive filter to remove whitespace-only nodes for minidom. The code is below. Strangely it deletes some whitespace nodes and leaves some. If I keep calling it -- like so: fws(fws(fws(doc))) then at some stage all the ws nodes disappear Does anybody have a clue? from x

using urlretrive/urlopen

2009-05-15 Thread Rustom Mody
I am trying to talk to a server that runs on localhost The server runs on http://localhost:7000/ and that opens alright in  a web browser. However if I use urlopen or urlretrieve what I get is this 'file' -- obviously not the one that the browser gets: Query 'http://localhost:7000/' not implemen

making a python program in windows

2009-05-21 Thread Rustom Mody
I know how to make a python script behave like a (standalone) program in unix -- 1. put a #! path/to/python as the first line 2. make the file executable The closest I know how to do this in windows is: r-click the file in win-explorer goto properties goto open with change pythonw to python Can s

pickle internals

2008-05-19 Thread Rustom Mody
I am trying to understand pickle internals. This involves: -- the algorithm(s) used for traversal arbitrary structures -- the pickle format -- the use if any of introspection I'll be thankful for any pointers PS Should this question be put on some other list?/ -- http://mail.python.org/mailman/li

python for driving the sound card

2008-06-26 Thread Rustom Mody
I am exploring the use of python to drive the sound card to experiment with tunings. How easy is it to write (or is it already available) to write a function chord which takes a (list of) frequencies and plays them? -- http://mail.python.org/mailman/listinfo/python-list

diffing and uniqing directories

2008-04-26 Thread Rustom Mody
Over years Ive collected tgz's of my directories. I would like to diff and uniq them Now I guess it would be quite simple to write a script that does a walk or find through a pair of directory trees, makes a SHA1 of each file and then sorts out the files whose SHA1s are the same/different. What is

python-mode errors

2008-08-17 Thread Rustom Mody
When I start python mode I get the error: idle error: # -Wrong number of arguments : # 2" The Python mode version is 4.78 Is this a known problem? Thanks -- http://mail.python.org/mailman/listinfo/python-list

rspec for python

2008-08-25 Thread Rustom Mody
Is there anything equivalent to rspec for python? -- http://mail.python.org/mailman/listinfo/python-list

Re: rspec for python

2008-08-25 Thread Rustom Mody
Gerhard Haring wrote: > Have you actually used this "rspec" thing in Ruby? I always wonder with > such things. > > Same with all the other hyped technologies of yesteryear. Anybody out > there who really uses model-driven development? > -- Gerhard > Two laws are (the) most fundamental in our f

execfile in python3 breaks emacs mode

2009-10-04 Thread Rustom Mody
Removing execfile from python3 has broken the good-ol python-mode of emacs. Changing the line In python-mode.el in function py-execute-file changing the line (cmd (format "execfile(r'%s') # PYTHON-MODE\n" filename))) to (cmd (format "exec(open(r'%s').read()) # PYTHON-MODE\n" filename))) seems

Re: execfile in python3 breaks emacs mode

2009-10-04 Thread Rustom Mody
Just answering my own question A little googling tells me to use (cmd (format "exec(compile(open('%s').read(), '%s', 'exec')) # PYTHON-MODE\n" filename filename))) instead of (cmd (format "exec(open(r'%s').read()) # PYTHON-MODE\n" filen

reifying indent and dedent into braces

2009-10-13 Thread Rustom Mody
At http://www.secnetix.de/olli/Python/block_indentation.hawk I find that the python code >>> if foo: ... if bar: ... x = 42 ... else: ... print foo ... has its indentation structure made explicit as <:>[0] <:> [0, 4] <=> <42> [0, 4,

cool-compiling python 3

2009-10-28 Thread Rustom Mody
I guess this is a bit OT but anyhow. I just finished compiling compiling python 3 on ubuntu and discovered that my laptop has a builtin toaster :-; Yeah I know this is not a python issue and probably modern laptops are meant to run wondrous beautiful elephantaneous things like eclipse coo

Another (simple) unicode question

2009-10-29 Thread Rustom Mody
Construct http://construct.wikispaces.com/ is a kick-ass binary file structurer (written by a 21 year old!) I thought of trying to port it to python3 but it barfs on some unicode related stuff (after running 2to3) which I am unable to wrap my head around. Can anyone direct me to what I should read

Re. Web development with Python 3.1

2009-10-31 Thread Rustom Mody
Rober Kern wrote > But if you insist, you may be interested in Breve: > http://pypi.python.org/pypi/Breve/ Thanks for that! Viva internal DSLs! [Sorry -- cut my teeth on lisp] Is there anything like this for xml? Well I guess that is a slightly wrong (if not straight stupid) question. Maybe s

Re: python simply not scaleable enough for google?

2009-11-17 Thread Rustom Mody
"Language L is (in)efficient. No! Only implementations are (in)efficient" I am reminded of a personal anecdote. It happened about 20 years ago but is still fresh and this thread reminds me of it. I was attending some workshop on theoretical computer science. I gave a talk on Haskell. I showed o

TDD in python

2010-11-28 Thread Rustom Mody
Does anyone know of something like this for python? http://www.vimeo.com/13240481 -- http://mail.python.org/mailman/listinfo/python-list

class browser

2010-12-08 Thread Rustom Mody
If I have a medium to large python code base to browse/study, what are the class browsers available? -- http://mail.python.org/mailman/listinfo/python-list

error return from urlopen

2009-08-05 Thread Rustom Mody
When I direct urlopen to a non-existent server process I get IOError: [Errno socket error] (10061, 'Connection refused') The connection refused is as expected but whats the 10061? strerror(10061) says 'unknown error' So its like an errno but not quite an errno? Can I find out more about this numb

compiling python 3

2009-09-13 Thread Rustom Mody
Just managed to compile python3 on debian lenny I get (among other things) 7 skips unexpected on linux2: test_dbm_ndbm test_bz2 test_ttk_guionly test_tcl test_tk test_ttk_textonly test_dbm_gnu Any ideas what dev packages I need to add? Also emacs python-mode is not set for python3 it look

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Rustom Mody
On Wed, Sep 29, 2010 at 12:44 PM, Chris Rebert wrote: > On Tue, Sep 28, 2010 at 11:43 PM, rustom wrote: > > A currently developed language with units is curl: see > > http://developers.curl.com/userdocs/docs/en/dguide/quantities-basic.html > > Frink's most recent version is only 17 days old. (Yo

PyRTF object model

2010-09-30 Thread Rustom Mody
I am trying to use PyRTF. I gather that an RTF doc consists of a list of sections, a section consists of a list of paras, paras seem to be just text (not sure on that one) Some questions: When does one end one section and start another? How does one handle lists (as in numbered, bulleted etc)? -

Re: Compare source code

2010-11-04 Thread Rustom Mody
The real issue is not tabs/spaces vs braces but academic/scientific orientation vs engineering/commercial needs. Mostly these worlds are so far separated that no dialogue happens -- think C vs Pascal, Java vs Eiffel etc The problem -- actually advantage -- is that Python straddles both worlds. Mai

Re: Compare source code

2010-11-05 Thread Rustom Mody
As for tools' brokeness regarding spaces/tabs/indentation heres a thread on the emacs list wherein emacs dev Stefan Monnier admits to the fact that emacs' handling in this regard is not perfect. http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/1bd0c33a3e755730/89cbd920ee651b5a?q=

python test frameworks

2010-11-06 Thread Rustom Mody
There are a large number of test frameworks in/for python. Apart from what comes builtin with python there seems to be nose, staf, qmtest etc etc. Is there any central place where these are listed with short descriptions? 'Test framework' means widely different things in different contexts. Any e

Re: Why "flat is better than nested"?

2010-11-08 Thread Rustom Mody
On Oct 26, 12:11 am, kj wrote: > In Steve Holden > writes: > > > > >And everyone taking the Zen too seriously should remember that it was > >written by Tim Peters one night during the commercial breaks between > >rounds of wrestling on television. So while it can give useful guidance, > >it's n

Re: PTH files: Abs paths not working as expected. Symlinks needed?

2017-02-16 Thread Rustom Mody
On Friday, February 17, 2017 at 3:24:32 AM UTC+5:30, Terry Reedy wrote: > On 2/15/2017 7:42 AM, poseidon wrote: > > > what are pth files for? > > They are for extending (mainly) lib/site-packages. Hey Terry! This needs to get into more public docs than a one-off post on a newsgroup/ML -- htt

Re: Swiss Ephemeris

2017-04-10 Thread Rustom Mody
On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson wrote: > The great ancients were no less endowed with intelligence than we are, they > simply directed it to different ends. And just when I was convinced by the all-knowers that my gpa was a monkey you've spoilt my complacence >

Re: Python and the need for speed

2017-04-11 Thread Rustom Mody
On Wednesday, April 12, 2017 at 3:32:57 AM UTC+5:30, Rick Johnson wrote: > On Monday, April 10, 2017 at 7:25:48 AM UTC-5, Mikhail V wrote: > > Still I miss some old school features in Python, e.g. > > "goto" statement would be very useful in some cases. > > Are you serious? > > > I know it is co

Re: Python and the need for speed

2017-04-11 Thread Rustom Mody
On Wednesday, April 12, 2017 at 7:38:12 AM UTC+5:30, Steve D'Aprano wrote: > On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: > > > I still do my everyday stuff in Python and I'd like to get more > > conversant with stuff like numpy, but it feels like an old-fashioned > > language these days. > >

Re: Python and the need for speed

2017-04-12 Thread Rustom Mody
On Wednesday, April 12, 2017 at 7:09:04 PM UTC+5:30, Ben Bacarisse wrote: > Steve D'Aprano writes: > > > On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: > > > >> I still do my everyday stuff in Python and I'd like to get more > >> conversant with stuff like numpy, but it feels like an old-fashion

Re: Calling dunder methods manually

2017-04-12 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:00:03 AM UTC+5:30, Steven D'Aprano wrote: > Should you call dunder methods (Double leading and trailing UNDERscores) > manually? For example: > > > my_number.__add__(another_number) > > > The short answer is: > > NO! In general, you shouldn't do it. > > > G

Re: Swiss Ephemeris

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 2:10:16 PM UTC+5:30, Deborah Swanson wrote: > Rustom Mody wrote, on Monday, April 10, 2017 11:50 PM > > > > On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson > wrote: > > > The great ancients were no less endowed with

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > > Now I wonder, have we already collected *all* bells and whistles of Python > > in these two examples, or is there something else for expressing trivial > > thing. > > Function

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:56:53 PM UTC+5:30, Rob Gaddi wrote: > On 04/13/2017 10:13 AM, Rustom Mody wrote: > > On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > >>> Now I wonder, have we

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. >

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 ago

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 performa

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 p

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: 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 only

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: 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 s

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 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 trol

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 by

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: 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] a

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 importantly

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: > > >> > <> > > Interesti

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: > > >> > <> > > Interestin

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 g

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

2017-05-08 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 ta

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

2017-05-09 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

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: 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 norma

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: 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, they

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 s

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'

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 doesn'

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 &

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. > > This

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 woul

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 t

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 give

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, paraphra

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 man'

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 firs

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 tuple

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 https://wiki.python.or

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" langua

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: 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 (nowadays

<    12   13   14   15   16   17   18   >