tutorial idea

2005-01-29 Thread ElctrcElctrcgtr1
have a java applet that runs python code, with a tutorial that goes along with it. that way you just have to go to a website to learn it, instead of downloading and installing a few programs. (i would make it so it assumes that you don't know how to program anything.) -- http://mail.python.org/mai

iterator idea

2006-10-26 Thread Paul Rubin
ad of calling it like a subroutine. The idea is to solve one of the perennial iterator annoyances, the inability to push items back on an iterator. For example, the annoyance means itertools.takewhile consumes an extra element with no reasonable way to retrieve it. The new feature would let us

Re: tutorial idea

2005-01-29 Thread Nick Coghlan
ElctrcElctrcgtr1 wrote: have a java applet that runs python code, with a tutorial that goes along with it. that way you just have to go to a website to learn it, instead of downloading and installing a few programs. (i would make it so it assumes that you don't know how to program anything.) Someth

Web functions idea

2005-11-29 Thread Mark Carter
I was musing recently about how one could, for example, set up a really simple mailing subscription list. It occurred to me that a really simple way to implement it would be to use xmlrpc. So there could be a function subscribe(emailAddress), which would send an email for confirmation, and anothe

Re: iterator idea

2006-10-26 Thread Duncan Booth
Paul Rubin wrote: ... > For example, the annoyance means itertools.takewhile consumes an extra > element with no reasonable way to retrieve it. ... > >def is_even(n): return (n%2 == 0) >def is_odd(n): return (n%2 != 0) > ># we want to do something with all

Re: iterator idea

2006-10-26 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > I wouldn't agree that there is no way reasonable way to get the terminating > value with takewhile, you just need another generator or two: Hmm, I hadn't thought about iterator.send. I'll have to look at that more carefully and re-read the PEP. -- http

snippet manager idea

2007-04-05 Thread [EMAIL PROTECTED]
Hi. I am writing a opensource code snippet manager in python (pyqt4). The idea is that users can upload their snippets to remote subversion server, (if they choose) and add comments to existing snippets, vote for snippet deletion, add flags to snippets: (tested, working, not working... etc) The

snippet manager idea

2007-04-05 Thread [EMAIL PROTECTED]
Hi. I am writing a opensource code snippet manager in python (pyqt4). The idea is that users can upload their snippets to remote subversion server, (if they choose) and add comments to existing snippets, vote for snippet deletion, add flags to snippets: (tested, working, not working... etc) The

A game idea.

2006-06-26 Thread defcon8
I have had what I think is quite a nice game idea, but I don't really have the experience or knowledge to go about it. Would anyone be willing to start a game project? The game I am thinking about is a virtual IRC stock exchange. There will be a bot in the channel which gets the live stock q

Re: Web functions idea

2005-11-29 Thread bruno at modulix
Mark Carter wrote: > I was musing recently about how one could, for example, set up a really > simple mailing subscription list. It occurred to me that a really simple > way to implement it would be to use xmlrpc. > So there could be a function > subscribe(emailAddress), > which would send an email

Re: Web functions idea

2005-11-29 Thread Mark Carter
bruno at modulix wrote: > Mark Carter wrote: > Congratulations, you've just rediscovered REST !-) Huzzah! > Turbogears is probably what you're looking for (if not quite what you > describe). Thanks. It looks quite interesting. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web functions idea

2005-11-29 Thread Larry Bates
The client software can be written in JavaScript that makes xmlrpc calls to the server (AJAX). That way there is no installation required. But there are loads of free, debugged mailing list programs out there that use email as the interface. You should take a look there first. -Larry Bates Mar

Help implementing an idea

2005-06-17 Thread Nicholas . Vaidyanathan
Well, I'm a total python n00b, but I was playing around with exception handling yesterday, and was stricken by how incredibly easy it is to use the op system to create nice scripts... I did the following: import sys lines = sys.stdin.readlines() lines.sort() for stuff in lines: print stuff ,

Re: snippet manager idea

2007-04-05 Thread kyosohma
On Apr 5, 9:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi. > I am writing a opensource code snippet manager in python (pyqt4). > The idea is that users can upload their snippets to remote subversion > server, (if they choose) and add comments to existing

idea for testing tools

2007-02-07 Thread Jens Theisen
Hello, I find it annoying that one has to write self.assertEqual(x, y) rather than just assert x == y when writing tests. This is a nuisance in all the programming languages I know of (which are not too many). In Python however, there appears to be a better alternative. The piece of code below

Re: A game idea.

2006-06-27 Thread Max M
defcon8 wrote: > I have had what I think is quite a nice game idea, but I don't really > have the experience or knowledge to go about it. Would anyone be > willing to start a game project? Ideas are a dime a dozen. Implementation is the hard part. If you want something done, you w

Re: Help implementing an idea

2005-06-17 Thread utabintarbo
Take a look at: http://dirssync.sourceforge.net/ See if that gives you any direction. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help implementing an idea

2005-06-17 Thread rh0dium
Try this.. #!/usr/bin/env python # Upload a file to a FTP server from sys import argv, exit from ftplib import FTP if len(argv) != 6: print 'Incorrect number of parameters' print 'USAGE: upload.py ' exit(0) server = argv[1] username = argv[2] password = argv[3] upfile = argv

Re: Help implementing an idea

2005-06-18 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Well, I'm a total python n00b, but I was playing around with exception >handling >yesterday, and was stricken by how incredibly easy it is to use the op system >to create nice scripts... I did the following: > >import sys >lines = sys.stdin.readlines() >lines.sort() >

Re: Help implementing an idea

2005-06-19 Thread gene tani
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299271 or the nice recipe, page 403 of cookbook2, that i can't find in ASPN -- http://mail.python.org/mailman/listinfo/python-list

Re: Help implementing an idea

2005-06-19 Thread Fuzzyman
[EMAIL PROTECTED] wrote: [snip..] > results. Now, I was thinking today, I'd really like to create a program that > can go to a specific directory and upload all the files in the directory to a > specific url for backup purposes, and I have the feeling that the python > implementation would be ruthl

the whole 'batteries included' idea

2006-04-20 Thread John Salerno
Pardon my naivety, you would think maybe I'd understand this by now, but I've always kind of wondered about it. I've been curious why one of the biggest points used to promote Python is that it has "batteries included." True, this is a great feature, but the way it's been used seems to suggest

Re: idea for testing tools

2007-02-07 Thread Bruno Desthuilliers
Jens Theisen a écrit : > Hello, > > I find it annoying that one has to write > > self.assertEqual(x, y) > > rather than just > > assert x == y > > when writing tests. This is a nuisance in all the programming > languages I know of (which are not too many). http://codespeak.net/py/current/doc/

Re: idea for testing tools

2007-02-08 Thread Jens Theisen
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > http://codespeak.net/py/current/doc/test.html#assert-with-the-assert-statement Ok, I didn't come across this before. I didn't work for me though, even the simple case #!/usr/bin/python a = 1 b = 2 def test_some(): assert a == b

Re: idea for testing tools

2007-02-08 Thread Eduardo \"EdCrypt\" O. Padoan
> #!/usr/bin/python > > a = 1 > b = 2 > > def test_some(): > assert a == b > > didn't reveal the values for a and b, though some more complex cases > showed something. def test_some(): print 'a:', a, 'b:', b assert a == b http://codespeak.net/py/current/doc/test.html#debug-w

Re: idea for testing tools

2007-02-08 Thread Paul Rubin
Jens Theisen <[EMAIL PROTECTED]> writes: > def test_some(): > assert a == b > > didn't reveal the values for a and b, though some more complex cases > showed something. I usually use assert a == b, (a,b) -- http://mail.python.org/mailman/listinfo/python-list

Re: idea for testing tools

2007-02-08 Thread Eduardo \"EdCrypt\" O. Padoan
> That's hardly desirable. If one is writing a test library that goes as > far as reparsing the assert statements, I can't see the point of > requiring the user to clutter his test suite with such spurious print > statements. After all, that's one of the main points of test suites in > the first pl

PEP 309 (Partial Function Application) Idea

2005-03-11 Thread Chris Perkins
Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list. 2) Have the compiler recognize the Ellipsis literal and transform

PEP 309 (Partial Function Application) Idea

2006-01-14 Thread Ronald Mai
;>> partial(capture, 1, _)(2) (1, 2) >>> partial(capture, 1, _)() IndexError: pop from empty list >>> partial(capture, 1, _, _)(2, 3) (1, 2, 3) Chris Perkins : > Random idea of the day: How about having syntax support for > currying/partial function application, like this:

Re: the whole 'batteries included' idea

2006-04-20 Thread Larry Bates
John Salerno wrote: > Pardon my naivety, you would think maybe I'd understand this by now, but > I've always kind of wondered about it. I've been curious why one of the > biggest points used to promote Python is that it has "batteries > included." True, this is a great feature, but the way it's bee

Re: the whole 'batteries included' idea

2006-04-20 Thread Jarek Zgoda
John Salerno napisał(a): > So my question is, what is the difference between Python's 'batteries' > (standard modules), and C#'s framework? I know nothing of Java, but I > assume it has its own rich (and confusing) set of classes as well. Is > there something different about other languages' libra

Re: the whole 'batteries included' idea

2006-04-21 Thread Ben Sizer
John Salerno wrote: > Pardon my naivety, you would think maybe I'd understand this by now, but > I've always kind of wondered about it. I've been curious why one of the > biggest points used to promote Python is that it has "batteries > included." True, this is a great feature, but the way it's bee

idea: add an asynchronous exception class

2006-03-03 Thread Paul Rubin
I'd like to suggest adding a builtin abstract class to Python called AsynchronousException, which would be a subclass of Exception. The only asynchronous exception I can think of right now is KeyboardInterrupt, so KeyboardInterrupt would become a subclass of AsynchronousException instead of being

Python 3000 idea -- + on iterables -> itertools.chain

2006-11-12 Thread John Reese
It seems like it would be clear and mostly backwards compatible if the + operator on any iterables created a new iterable that iterated throught first its left operand and then its right, in the style of itertools.chain. This would allow summation of generator expressions, among other things, to h

One module per class, bad idea?

2006-12-12 Thread Matias Jansson
I come from a background of Java and C# where it is common practise to have one class per file in the file/project structure. As I have understood it, it is more common practice to have many classes in a Python module/file. What is the motivation behind it, would it be a bad idea to have a

Re: PEP 309 (Partial Function Application) Idea

2005-03-11 Thread Steven Bethard
Chris Perkins wrote: Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list. 2) Have the compiler recognize the Ellipsis

Re: PEP 309 (Partial Function Application) Idea

2005-03-11 Thread Reinhold Birkenfeld
Steven Bethard wrote: > Chris Perkins wrote: >> Random idea of the day: How about having syntax support for >> currying/partial function application, like this: >> >> func(..., a, b) >> func(a, ..., b) >> func(a, b, ...) >> >> That is: >>

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Scott David Daniels
Reinhold Birkenfeld wrote: Steven Bethard wrote: Chris Perkins wrote: Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Chris Perkins
>Scott David Daniels wrote: >>>Chris Perkins wrote: >>>>Random idea of the day: How about having syntax support for >>>>currying/partial function application, like this: >>>>func(..., a, b) >>>>func(a, ..., b) >>>>func(a, b, .

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Steven Bethard
ion out of nothing[2]: button.setlabel(lambda: 'Click Me!') button.setlabel('Click Me!'.__str__) # works 'cause str returns self adding arguments[1]: lambda x: "" adding method to an instance[1]: self.plural = lambda n: int(n != 1) So I guess it's a cool idea, bu

Re: PEP 309 (Partial Function Application) Idea

2005-03-14 Thread Chris Perkins
self.plural = lambda n: int(n != 1) and _maybe_ even: self.plural = int(__ != 1) But wait - on second thought, "__" is a legal identifier now, unlike "...", so we can't have the compiler messing around with expressions like foo(x, __), can we. OK, now I really give up on the whole idea! Chris Perkins -- http://mail.python.org/mailman/listinfo/python-list

idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I have an idea to build python module to speed up python code in some of field where pyrex shines such as numeric, code which needs a lot of looping etc. What do you think? Sincerely Yours, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
Ronald Mai wrote: > Here is a reference implementation: > > _ = lambda x: x.pop(0) > > def partial(func, *args, **keywords): > def newfunc(*fargs, **fkeywords): > newkeywords = keywords.copy() > newkeywords.update(fkeywords) > newargs = (lambda seq: tupl

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread bonono
Giovanni Bajo wrote: > Ronald Mai wrote: > > > Here is a reference implementation: > > > > _ = lambda x: x.pop(0) > > > > def partial(func, *args, **keywords): > > def newfunc(*fargs, **fkeywords): > > newkeywords = keywords.copy() > > newkeywords.update(fkeywords)

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Since python has named parameter(and I assume this PEP would support > it as well), is it really that useful to have these place holder things > ? Probably not so much, you're right. > As when the parameter list gets long, named param should be easier to > read. > > Th

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
for a new function, named parameter might be a better choise, but for existing function, placeholder would be better, since you don't need to modify the exiting code. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
sorry, should be "existing" -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
for a new function, named parameter might be a better choise, but for existing function, placeholder would be better, since you don't need to modify the existing code. -- http://mail.python.org/mailman/listinfo/python-list

are docstrings for variables a bad idea?

2006-04-21 Thread jelle
That's basically the idea... Often i find myself annotating what variables actually stand for, so to refer back to the code in half a year or so. # check if ID's or coords self.pointIDs = ptIDs self.coords = [tuple(RS.PointCoordinates(i)) for i in ptIDs] # map ids/coords and

Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Charles D Hixson
I was reading through old messages in the list and came up against an idea that I thought might be of some value: "Wouldn't it be a good idea if one could "rewind" an iterator?" Not stated in precisely those terms, perhaps, but that's the way I read it. I appreciate

Re: idea: add an asynchronous exception class

2006-03-03 Thread Steven D'Aprano
On Fri, 03 Mar 2006 22:31:49 -0800, Paul Rubin wrote: > I'd like to suggest adding a builtin abstract class to Python called > AsynchronousException, which would be a subclass of Exception. [snip rationale] +1 on this. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Py3K idea: why not drop the colon?

2006-11-09 Thread Michael Hobbs
Can anyone find a flaw with this change in syntax? Instead of dividing a compound statement with a colon, why not divide it on a newline? For example, the colon could be dropped from this statement: if self.hungry: self.eat() to if self.hungry self.eat() Python is already

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-12 Thread Fredrik Lundh
John Reese wrote: > It seems like it would be clear and mostly backwards compatible if the > + operator on any iterables created a new iterable that iterated > throught first its left operand and then its right, in the style of > itertools.chain. you do know that "iterable" is an informal interf

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-12 Thread George Sakkis
Fredrik Lundh wrote: > John Reese wrote: > > > It seems like it would be clear and mostly backwards compatible if the > > + operator on any iterables created a new iterable that iterated > > throught first its left operand and then its right, in the style of > > itertools.chain. > > you do know th

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-12 Thread Fredrik Lundh
George Sakkis wrote: > The base object class would be one candidate, similarly to the way > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. > > Alternatively, iter() could be a wrapper type (or perhaps mixin) > instead of a function, something like: so you're proposing to

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
George Sakkis wrote: > Fredrik Lundh wrote: > >> John Reese wrote: >> >> > It seems like it would be clear and mostly backwards compatible if the >> > + operator on any iterables created a new iterable that iterated >> > throught first its left operand and then its right, in the style of >> > iter

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
red", as you get now for attempting "x in y" for non-iterable y, why not ? Although I like the iterator algebra idea better. > not sure how that matches the OP's wish for "mostly backwards > compatible" support for *iterable* algebra, really... Given the subject

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
Georg Brandl wrote: > What has a better chance of success in my eyes is an extension to yield > all items from an iterable without using an explicit for loop: instead of > > for item in iterable: > yield item > > you could write > > yield from iterable > > or > > yield *iterable Since this is

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
ot;+"' is implied that you can get a "TypeError: > iterable argument required", as you get now for attempting "x in y" for > non-iterable y, why not ? Bad idea on many, many levels. Don't go there. > Although I like the iterator algebra idea > bet

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
; > > introduce limited *iterator* algebra. > > > > If by 'respond to "+"' is implied that you can get a "TypeError: > > iterable argument required", as you get now for attempting "x in y" for > > non-iterable y, why not ? > &g

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
Carl Banks wrote: > Georg Brandl wrote: >> What has a better chance of success in my eyes is an extension to yield >> all items from an iterable without using an explicit for loop: instead of >> >> for item in iterable: >> yield item >> >> you could write >> >> yield from iterable >> >> or >>

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
George Sakkis wrote: > Carl Banks wrote: > > George Sakkis wrote: > > > If by 'respond to "+"' is implied that you can get a "TypeError: > > > iterable argument required", as you get now for attempting "x in y" for > > >

Re: One module per class, bad idea?

2006-12-12 Thread billie
> would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? Yes, it would be a bad idea. =) -- http://mail.python.org/mailman/listinfo/python-list

Re: One module per class, bad idea?

2006-12-12 Thread Fredrik Lundh
Matias Jansson wrote: > I come from a background of Java and C# where it is common practise to have > one class per file in the file/project structure. As I have understood it, > it is more common practice to have many classes in a Python module/file. even more important is that in Python, you

Re: One module per class, bad idea?

2006-12-12 Thread Fuzzyman
it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? It's not a bad general guideline. We try and use one class per file unless they are really trivial or tightly

Re: One module per class, bad idea?

2006-12-12 Thread Andy Dingley
Matias Jansson wrote: > I come from a background of Java and C# where it is common practise to have > one class per file in the file/project structure. Don't confuse packages and files. Java commonly splits a package across many files, Python binds a module to a single file. If you see "Java pa

Re: One module per class, bad idea?

2006-12-12 Thread Paddy
s in a Python module/file. > What is the motivation behind it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? Hi, This is one of the cases where Java and C# common

Re: One module per class, bad idea?

2006-12-12 Thread Isaac Rodriguez
> Yes, it would be a bad idea. =) Saying it is a bad idea and not explaining why will not help anyone. I would like you to elaborate on why it is a bad idea to have one file per class. Thanks, - Isaac. -- http://mail.python.org/mailman/listinfo/python-list

Re: One module per class, bad idea?

2006-12-12 Thread Carl J. Van Arsdall
Isaac Rodriguez wrote: >> Yes, it would be a bad idea. =) >> > > Saying it is a bad idea and not explaining why will not help anyone. I > would like you to elaborate on why it is a bad idea to have one file > per class. > A module per class makes a lot of sen

Re: One module per class, bad idea?

2006-12-12 Thread Isaac Rodriguez
operate in objects of the class are considered part of the interface) in their own module. I will like to understand why this will not be a good idea for python, other than to make beautiful import statements that is. Thanks, - Isaac. -- http://mail.python.org/mailman/listinfo/python-list

Re: One module per class, bad idea?

2006-12-12 Thread Gabriel Genellina
On 12 dic, 16:17, "Isaac Rodriguez" <[EMAIL PROTECTED]> wrote: > > Yes, it would be a bad idea. =)Saying it is a bad idea and not explaining > > why will not help anyone. I > would like you to elaborate on why it is a bad idea to have one file > per c

Re: One module per class, bad idea?

2006-12-12 Thread Carl Banks
Carl J. Van Arsdall wrote: > Isaac Rodriguez wrote: > >> Yes, it would be a bad idea. =) > >> > > > > Saying it is a bad idea and not explaining why will not help anyone. I > > would like you to elaborate on why it is a bad idea to have one file > > pe

Re: One module per class, bad idea?

2006-12-12 Thread Carl Banks
it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? One class per module is like having a filing system where you limit yourself to one piece of paper per file.

Re: One module per class, bad idea?

2006-12-12 Thread Carl J. Van Arsdall
Carl Banks wrote: > Carl J. Van Arsdall wrote: > >> Isaac Rodriguez wrote: >> >>>> Yes, it would be a bad idea. =) >>>> >>>> >>> Saying it is a bad idea and not explaining why will not help anyone. I >>> woul

Re: One module per class, bad idea?

2006-12-12 Thread Carl Banks
Carl J. Van Arsdall wrote: > Carl Banks wrote: > > Carl J. Van Arsdall wrote: > >> A module per class makes a lot of sense in some cases, or rather, make > >> your module your class (look at the singleton pattern). I actually like > >> to structure all of my code like this, it helps me keep things

Re: One module per class, bad idea?

2006-12-12 Thread Paddy
Isaac Rodriguez wrote: > I will like to understand why this will not be a good idea for python, > other than to make beautiful import statements that is. > > Thanks, > > - Isaac. Read more Python source Isaac. especially for modules you like to use. That way you see how others u

Re: One module per class, bad idea?

2006-12-13 Thread billie
Isaac Rodriguez wrote: > > Yes, it would be a bad idea. =) > > Saying it is a bad idea and not explaining why will not help anyone. I > would like you to elaborate on why it is a bad idea to have one file > per class. > > Thanks, > > - Isaac. Because it's jus

Re: One module per class, bad idea?

2006-12-13 Thread mystilleef
it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? It's a good idea. And I encourage it in my project. It makes sense for us because we document classes and met

Re: One module per class, bad idea?

2006-12-15 Thread Jorgen Grahn
ses in a Python module/file. > What is the motivation behind it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? Never mind their background; think about thei

Re: One module per class, bad idea?

2006-12-22 Thread Kent Johnson
Carl Banks wrote: > Now, I think this is the best way to use modules, but you don't need to > use modules to do get higher-level organization; you could use packages > instead. It's a pain if you're working on two different classes in the > same system you have to keep switching files; but I guess

Re: One module per class, bad idea?

2006-12-22 Thread Carl Banks
Kent Johnson wrote: > Carl Banks wrote: > > Now, I think this is the best way to use modules, but you don't need to > > use modules to do get higher-level organization; you could use packages > > instead. It's a pain if you're working on two different classes in the > > same system you have to kee

Re: One module per class, bad idea?

2006-12-22 Thread Erik Johnson
There are arguments of preference to be made on both sides. I think the question largely comes down to what is "workable" and "maintainable". To answer the original question, I think it is not necessarily a bad idea to have one class per file. But if your classes are small

Re: One module per class, bad idea?

2006-12-22 Thread Carl Banks
Erik Johnson wrote: > The file has now grown into a 6800 line beast (including docstring, > whitespace, and CVS history). Pretty much any time we implement some new > functionality, there are at least a few changes in that file. When you have > multiple developers working on different project

Re: One module per class, bad idea?

2006-12-22 Thread Paddy
Carl Banks wrote: > Erik Johnson wrote: > > The file has now grown into a 6800 line beast (including docstring, > > whitespace, and CVS history). Pretty much any time we implement some new > > functionality, there are at least a few changes in that file. When you have > > multiple developers

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
At Friday 22/12/2006 12:56, Kent Johnson wrote: It does make the imports look funny - I tend to give the module the same name as the class, Java style, so I have from foo.bar.MyClass import MyClass but that is a minor point IMO. You can always arrange things at the module level (inside __init

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
At Friday 22/12/2006 20:25, Paddy wrote: Are there tools out their to help with the refactoring task of splitting a module into two or more sections then showing what other files need to change? Usually no other files need to change. Ex: you have BigOldModule including ClassA, ClassB and Func

Re: One module per class, bad idea?

2006-12-22 Thread Carl Banks
Paddy wrote: > Carl Banks wrote: > > Erik Johnson wrote: > > > The file has now grown into a 6800 line beast (including docstring, > > > whitespace, and CVS history). Pretty much any time we implement some new > > > functionality, there are at least a few changes in that file. When you > >

Re: One module per class, bad idea?

2006-12-22 Thread Carl Banks
Gabriel Genellina wrote: > At Friday 22/12/2006 20:25, Paddy wrote: > > >Are there tools out their to help with the refactoring task of > >splitting a module into two or more sections then showing what other > >files need to change? > > Usually no other files need to change. Ex: you have BigOldMod

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
At Friday 22/12/2006 22:58, Carl Banks wrote: > Usually no other files need to change. Ex: you have BigOldModule > including ClassA, ClassB and FunctionC. Move each one onto its own > module, perhaps including a subset of the original imports of BigOldModule. > Shrink BigOldModule to just: > > f

Re: One module per class, bad idea?

2006-12-22 Thread Carl Banks
Gabriel Genellina wrote: > At Friday 22/12/2006 22:58, Carl Banks wrote: > > > > Usually no other files need to change. Ex: you have BigOldModule > > > including ClassA, ClassB and FunctionC. Move each one onto its own > > > module, perhaps including a subset of the original imports of > > > BigO

Re: One module per class, bad idea?

2006-12-23 Thread stdazi
it, would it be a bad idea to have a guideline > in your project that promotes a one class per file structure (assuming most > of the programmers a background similar to mine)? IMO, even the Java practice is weird. I think classes should be split into different files/modules due to their con

Re: One module per class, bad idea?

2006-12-25 Thread Kent Johnson
Carl Banks wrote: > Kent Johnson wrote: >> Carl Banks wrote: >>> Now, I think this is the best way to use modules, but you don't need to >>> use modules to do get higher-level organization; you could use packages >>> instead. It's a pain if you're working on two different classes in the >>> same s

Re: One module per class, bad idea?

2006-12-25 Thread Carl Banks
Kent Johnson wrote: > Carl Banks wrote: > > Kent Johnson wrote: > >> Carl Banks wrote: > >>> Now, I think this is the best way to use modules, but you don't need to > >>> use modules to do get higher-level organization; you could use packages > >>> instead. It's a pain if you're working on two di

A proposal idea for string.split with negative maxsplit

2005-01-28 Thread Antoon Pardon
I was wondering what people whould think about a change of behaviour in the split method fo strings. The idea would be that if maxsplit was negative then abs(maxsplit) splits would be done, but splitting would start from the right instead of the left. Now we have. >>> "st1:s

Re: idea of building python module using pyrex

2005-12-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I have an idea to build python module to speed up python code in some > of field where pyrex shines such as numeric, code which needs a lot of > looping etc. Isn't numeric already written in C? -- Regards, Diez B. Roggisch -- ht

Re: idea of building python module using pyrex

2005-12-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have an idea to build python module to speed up python code in some > of field where pyrex shines such as numeric, code which needs a lot of > looping etc. > > What do you think? I don't think you need anyone's permission to do that, really.

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I just wonder if someone has already build it. Thanks for the response. Best Regards, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I just wonder if someone has already build it. built what? it's not like nobody's ever built a Python module using Pyrex before, so I guess you have to be a bit more precise if you want feedback. -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
For example stastical module like commulative probability function for t distribution, or other numerical module which incorporate looping to get the result. I found that pyrex is very helpfull when dealing with looping things. pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread David M. Cooke
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > For example stastical module like commulative probability function for > t distribution, or other numerical module which incorporate looping to > get the result. > > I found that pyrex is very helpfull when dealing with looping > things. Pyrex is

  1   2   3   4   5   >