Re: Proposal: Inline Import

2005-12-19 Thread en.karpachov
-- http://mail.python.org/mailman/listinfo/python-list

Re: Batteries Included?

2005-10-11 Thread en.karpachov
On 11 Oct 2005 00:10:01 -0700 Paul Rubin wrote: > Personally I think including a .exe packager in Python would be a > great idea. As a Linux user I can't easily run Windows-specific > utilities like Inno Setup. So I don't have a good way to make .exe's > from my Python code that Windows users ca

Re: Let My Terminal Go

2005-10-11 Thread en.karpachov
On 10 Oct 2005 22:58:08 -0700 [EMAIL PROTECTED] wrote: > How do I implement this in my application written in python? Google for "python daemonize". -- jk -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread en.karpachov
On Mon, 03 Oct 2005 17:43:35 +0100 Steve Holden wrote: > Hmm. Presumably introspection via getattr() is way too dangerous, then? Sure, it is dangerous. Not a showstopper, though. I mean, the absolute address access in the C is too dangerous, yes, but it doesn't make declarations in C any less u

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread en.karpachov
On Tue, 04 Oct 2005 01:46:49 +1000 Steven D'Aprano wrote: > errors and not rely on the compiler. No compiler will catch this error: > > x = 12.0 # feet > # three pages of code > y = 15.0 # metres > # three more pages of code > distance = x + y > if distance < 27: > fire_retro_rockets() > > A

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread en.karpachov
On 3 Oct 2005 13:58:33 GMT Antoon Pardon wrote: > People often promote unittesting here. Writing all those unittest is > an added burden too. But people think this burden is worth it. > > I think writing declaration is also worth it. The gain is not as > much as with unittesting but neither is th

Re: Will python never intend to support private, protected and public?

2005-10-01 Thread en.karpachov
On 30 Sep 2005 22:11:46 + John J. Lee wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > That would make a good Onion (www.TheOnion.com) headline: "Users > > Discover Computer Security Conflicts with Desire for Convenience" > > :-) The Onion, yay. > > Area Man Forgets Work Password, Will

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-01 Thread en.karpachov
On Fri, 30 Sep 2005 21:28:26 -0400 Terry Reedy wrote: > > The lesson for me is to spend much less time on Python discussion and much > more on unfinished projects. So even if I never use the new syntax, I will > have gained something ;-) QOTW? -- jk -- http://mail.python.org/mailman/listinf

Re: Will python never intend to support private,protected and public?

2005-10-01 Thread en.karpachov
On 30 Sep 2005 15:00:39 -0700 Paul Rubin wrote: > Rocco Moretti <[EMAIL PROTECTED]> writes: > > There is little in the way of technical problems that are solved by > > language level enforcement of private variables. The issues in > > question are mostly social ones, and if you're not reading and

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Fri, 30 Sep 2005 06:31:44 +0200 Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Looks like you must know every one of the base classes of the NotSoSecret, > > whether there is some base class named Secret? And, if so, you must also > > know these classes _implementation_ > > that inform

Re: Feature Proposal: Sequence .join method

2005-09-29 Thread en.karpachov
On Thu, 29 Sep 2005 20:37:31 -0600 Steven Bethard wrote: > I don't like the idea of having to put this on all sequences. If you > want this, I'd instead propose it as a function (perhaps builtin, > perhaps in some other module). itertools module seems the right place for it. itertools.chain(*

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Thu, 29 Sep 2005 21:05:28 +0200 Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Do you ever heard of that funny things named "an interface" and "an > > implementation"? > > the "shared DLL:s ought to work" school of thought, you mean? No, the other way around: my app works when I upgra

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Thu, 29 Sep 2005 16:59:01 +0200 Fredrik Lundh wrote: > as long as you don't cheat, that is: > > # your code > > class Secret: > def __init__(self): > self.__hidden = "very secret value" > > # my code > > from yourcode import Secret > > class Secret(Secret): > def gethidden(

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Thu, 29 Sep 2005 17:03:00 +0200 Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > What if the access to that variable was forbidden for reasons you never > > foresaw? What if the class author decide to remove the variable in the next > > version of the class, because it's not an interface,

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Fri, 30 Sep 2005 00:16:02 +1000 Steven D'Aprano wrote: > Say you have written a class, with a private variable. I decide that I > need access to that variable, for reasons you never foresaw. What if the access to that variable was forbidden for reasons you never foresaw? What if the class auth

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread en.karpachov
On Wed, 28 Sep 2005 08:14:50 -0500 Chris Gonnerman wrote: > There are two philosophies about programming: > > -- Make it hard to do wrong. > > -- Make it easy to do right. > > What you are promoting is the first philosophy: Tie the programmer's > hands so he can't do wrong. Python for the most

Re: Finding where to store application data portably

2005-09-22 Thread en.karpachov
On Thu, 22 Sep 2005 00:23:56 +1000 Steven D'Aprano wrote: > I wish the Linux Standard Base folks would specify that settings files > should all go into a subdirectory like ~/settings rather than filling up > the home directory with cruft. That was acceptable in the days when people > only looked a

Re: Roguelike programmers needed

2005-09-18 Thread en.karpachov
On Sun, 18 Sep 2005 17:28:30 +0100 Thomas Jollans wrote: > what exactly is RPG/roguelike etc ? (what debian package provides an > example?) apt-cache search roguelike -- jk -- http://mail.python.org/mailman/listinfo/python-list

Re: O'Reilly book on Twisted

2005-09-15 Thread en.karpachov
On 14 Sep 2005 13:36:53 -0700 Steve M wrote: > Does anybody know: > > What is the relationship between the primary developers of Twisted and > the book? Looks like the primary developers will get a copy from the author, at least. :) Having a book is nice, of course, but I'd rather rely on the m

Re: Do int.__lt__/__gt__/etc. exist?

2005-09-06 Thread en.karpachov
On Wed, 07 Sep 2005 00:02:49 GMT Chris Dutton wrote: > I'm just curious. I've been trying to demonstrate functional thinking > in Python, but I can't find these methods for int objects. It would be > immensely helpful for something like: > > filter(4 .__lt__, range(10)) > > As opposed to: >

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread en.karpachov
On Tue, 06 Sep 2005 12:19:21 +0200 Torsten Bronger wrote: > "talin at acm dot org" <[EMAIL PROTECTED]> writes: > > Anyway, here's an example, then, of how 'def' could be used: > > > > add = def( a, b ): > >return a + b > > I'm really not an expert in functional programming, so I wonder > what

Re: Python doc problems example: gzip module

2005-09-01 Thread en.karpachov
On 1 Sep 2005 07:24:26 -0700 Peter Wang wrote: > >> Constructor for the GzipFile class, which simulates most of the methods > >> of a file object, with the exception of the readinto() and truncate() > > > > yeah, blab blab blab. what the fuck are you talking about? So, how to > > use it? > >> a

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-24 Thread en.karpachov
On Thu, 25 Aug 2005 00:05:18 -0400 Steve Holden wrote: > What on earth makes you call this a bug? And what are you proposing that > find() should return if the substring isn't found at all? please don't > suggest it should raise an exception, as index() exists to provide that > functionality.

Re: Doubt C and Python

2005-08-23 Thread en.karpachov
On 23 Aug 2005 01:22:31 -0700 James wrote: > > Some people with C background use Python instead > > of programming in C.why? > > Becuase it is much more efficient. It's rather because _they_ are much more efficient (that is, with Python). -- jk -- http://mail.python.org/mailman/listinfo/pyt

Well, another try Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 18 Aug 2005 22:21:53 -0700 Greg McIntyre wrote: > f = open("blah.txt", "r") > while True: > c = f.read(1) > if c == '': break # EOF > # ... work on c > > Is some way to make this code more compact and simple? It's a bit > spaghetti. > > This is what I would ideally like:

Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 19 Aug 2005 03:43:31 -0700 Paul Rubin wrote: > <[EMAIL PROTECTED]> writes: > > import itertools > > f = open("blah.txt", "r") > > for c in itertools.chain(*f): > > But that can burn an unlimited amount of memory if there are long > stretches of the file with no newlines. There's no real good

Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 18 Aug 2005 22:21:53 -0700 Greg McIntyre wrote: > I have a Python snippet: > > f = open("blah.txt", "r") > while True: > c = f.read(1) > if c == '': break # EOF > # ... work on c > > Is some way to make this code more compact and simple? It's a bit > spaghetti. import i

Re: Embedding Python in C, undefined symbol: PyExc_FloatingPointError

2005-08-17 Thread en.karpachov
On Wed, 17 Aug 2005 14:29:43 +0800 Simon Newton wrote: > The C program is being built like so: > > gcc main.c -c -I-I/usr/include -I/usr/include -I/usr/include/python2.4 > -I/usr/include/python2.4 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > gcc main.o -L/usr/lib -lpthread -ldl -lutil > -lm /us

Re: "Compile time" checking?

2005-08-13 Thread en.karpachov
On Fri, 12 Aug 2005 22:25:07 -0700 Steve Jorgensen wrote: > Since Python does not use manifest typing, there's not much you can do about > this, but typeless languages like this are great if you're using a process > that finds the errors the compiler would otherwise find. I'm referring, of > cour

Re: Python supports LSP, does it?

2005-08-11 Thread en.karpachov
On Thu, 11 Aug 2005 15:02:08 -0400 Terry Reedy wrote: > I remember discussion of the LSP on comp.object some years ago when I > was reading it. (I presume there still are, just don't read it > anymore.). One of the problems is that biology and evolution do not > obey it. Birds (in general) c

Re: Python supports LSP, does it?

2005-08-10 Thread en.karpachov
On Thu, 11 Aug 2005 01:19:19 +0100 phil hunt wrote: > According to Wikipedia, the Liskov substitution principle is: > > Let q(x) be a property provable about objects x of type T. Then > q(y) should be true for objects y of type S where S is a subtype of T > > To me, this is nonsense. Under

Re: "Compile time" checking?

2005-08-10 Thread en.karpachov
On 10 Aug 2005 08:53:15 -0700 Qopit wrote: > def tester(a,b,c): > print "bogus test function",a,b,c > tester(1,2,3) #this runs fine > tester(1,2)#this obviously causes a run-time TypeError exception /tmp% cat >a.py def tester(a,b,c): print "bogus test function",a,b,c tester(1,2,3) #this

Re: What are modules really for?

2005-08-10 Thread en.karpachov
On Wed, 10 Aug 2005 09:36:13 +0100 N.Davis wrote: > As for multiple inheritance, yes I've always been aware of it being > available in C++, but I learned C++ at a company which banned multiple > inheritance in their coding standards, with comments about "The GOTO of > the 1990s". Looks like so

Re: What are modules really for?

2005-08-09 Thread en.karpachov
On Tue, 09 Aug 2005 16:32:31 +0100 N.Davis wrote: > With single inheritance in C++ or Java, if you wanted to see what a > method did and it appeared to be inherited, you would simply look in the > base class's file, and if necessary recurse up the inheritance hierarchy > until you found the met

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread en.karpachov
On 5 Aug 2005 08:34:32 -0700 [EMAIL PROTECTED] wrote: > Is there a better way of doing this so that I don't have to go through > every permutation of possible arguments (the example here from the > matplotlib 'plot' function): > > def makeplot(self, xvalues, yvalues, linecolor='', linewidth=''):

Re: Python IDE's

2005-08-01 Thread en.karpachov
On Mon, 01 Aug 2005 18:21:08 -0400 Benji York wrote: > Jon Hewer wrote: > > But, if i use Vi, then whenever i want to test some code i have to > > open up python, import the necessary modules and run it - I like the > > idea of developing python in an IDE and just hitting a run button. > > map :

Re: Wheel-reinvention with Python (was: Ten Essential DevelopmentPractices)

2005-07-29 Thread en.karpachov
On Fri, Jul 29, 2005 at 01:18:10PM -0400, Jeremy Moles wrote: > On Fri, 2005-07-29 at 17:59 +0200, Torsten Bronger wrote: > > one thinks "well, perfect, I have the choice between four > > Four? > > 1. wx > 2. PyGTK > 3. Tk (Are you including this one even?) > 4. ??? Well, QT at least. And sure

Re: how to write a line in a text file

2005-07-25 Thread en.karpachov
Tue, Jul 26, 2005 at 01:41:36PM +1000, Steven D'Aprano пишет: > Long ago, when dinosaurs roamed the Earth, (a.k.a. > "before OS X on the Macintosh") Apple suggested a bit > of Pascal code for safely updating a file: > > http://developer.apple.com/documentation/mac/Files/Files-25.html#MARKER-9-16

Re: Invoke a method to a specific thread

2005-07-24 Thread en.karpachov
Mon, Jul 25, 2005 at 01:20:39PM +0800, Varghj?rta пишет: > When doing GUI apps in C# I often have to call a method that will > modify the GUI somehow from a different thread then the GUI is on (to > allow for GUI responsiveness). I simply call Invoke() or BeginInvoke > which resides in another thre