Re: API design question for dbf.py

2012-07-06 Thread Ethan Furman
Devin Jeanpierre wrote: On Fri, Jul 6, 2012 at 6:46 PM, Ethan Furman wrote: It's checking for equality, not identity. >>> x = float('nan') >>> x in [x] True It's checking for equality OR identity. Good point. In my case, checking for equality will cover both cases. ~Ethan~ -- http:

Re: API design question for dbf.py

2012-07-06 Thread Devin Jeanpierre
On Fri, Jul 6, 2012 at 6:46 PM, Ethan Furman wrote: > It's checking for equality, not identity. >>> x = float('nan') >>> x in [x] True It's checking for equality OR identity. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: API design question for dbf.py

2012-07-06 Thread Ethan Furman
MRAB wrote: On 06/07/2012 22:34, Ethan Furman wrote: I'm looking for some free advice. ;) My dbf module has three basic containers, all of which support list-like access: Table, List, and Index, each of which is filled with _DbfRecords. The fun part is that a _DbfRecord can compare equal t

Re: API design question for dbf.py

2012-07-06 Thread MRAB
On 06/07/2012 22:34, Ethan Furman wrote: I'm looking for some free advice. ;) My dbf module has three basic containers, all of which support list-like access: Table, List, and Index, each of which is filled with _DbfRecords. The fun part is that a _DbfRecord can compare equal to another _DbfR

API design question for dbf.py

2012-07-06 Thread Ethan Furman
I'm looking for some free advice. ;) My dbf module has three basic containers, all of which support list-like access: Table, List, and Index, each of which is filled with _DbfRecords. The fun part is that a _DbfRecord can compare equal to another _DbfRecord, a _DbfRecordTemplate, a tuple wi

Re: design question

2011-04-10 Thread Andrea Crotti
Andrea Crotti writes: [...] I left the Timeline as before, but tried to rewrite some more classes. This is the abstract class for a metric, and below another class for the metric which involve only counting things. In the end an example on how to use this. I need to see synthetic values during

design question

2011-04-10 Thread Andrea Crotti
I've been wondering for weeks now how to do but I still didn't get a satisfying answer, so I hope someone can give a hint... I have some logs which I extract from simulation results. These logs are in the form timestamp, nodeid, eventname, event_argument and now I have to analyze the data. I don

Re: Framework design question

2010-12-05 Thread MRAB
On 05/12/2010 18:20, Alan Harris-Reid wrote: Hi, When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/' format needs to be converted to a Python d

Framework design question

2010-12-05 Thread Alan Harris-Reid
Hi, When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/' format needs to be converted to a Python date-object or '-mm-dd' in order to be

Re: Helper classes design question

2010-08-25 Thread John O'Hagan
On Tue, 24 Aug 2010, Jean-Michel Pichavant wrote: > John O'Hagan wrote: > > I want to know the best way to organise a bunch of functions designed to > > operate on instances of a given class without cluttering the class itself > > with a bunch of unrelated methods. > > > > What I've done is make w

Re: Helper classes design question

2010-08-24 Thread Jean-Michel Pichavant
John O'Hagan wrote: I want to know the best way to organise a bunch of functions designed to operate on instances of a given class without cluttering the class itself with a bunch of unrelated methods. What I've done is make what I think are called helper classes, each of which are initialize

Re: Helper classes design question

2010-08-24 Thread Steven D'Aprano
On Mon, 23 Aug 2010 19:22:46 +0200, Thomas Jollans wrote: > On Monday 23 August 2010, it occurred to John O'Hagan to exclaim: [...] >> I'm not sure if I'm on the right track here design-wise. Maybe this >> could be better done with inheritance (not my forte), but my first >> thought is that no, th

Re: Helper classes design question

2010-08-23 Thread Thomas Jollans
On Monday 23 August 2010, it occurred to John O'Hagan to exclaim: > I want to know the best way to organise a bunch of functions designed to > operate on instances of a given class without cluttering the class itself > with a bunch of unrelated methods. > > What I've done is make what I think are

Re: Helper classes design question

2010-08-23 Thread Peter Otten
John O'Hagan wrote: > I want to know the best way to organise a bunch of functions designed to > operate on instances of a given class without cluttering the class itself > with a bunch of unrelated methods. > > What I've done is make what I think are called helper classes, each of > which are in

Helper classes design question

2010-08-23 Thread John O'Hagan
I want to know the best way to organise a bunch of functions designed to operate on instances of a given class without cluttering the class itself with a bunch of unrelated methods. What I've done is make what I think are called helper classes, each of which are initialized with an instance of

Re: design question

2010-05-04 Thread Tim Arnold
On May 4, 3:39 am, Bruno Desthuilliers wrote: > Alf P. Steinbach a écrit : > (snip) > > > Re efficiency it seems to be a complete non-issue, but correctness is > > much more important: is there any way that the config details can be > > (inadvertently) changed while the build is going on? > > +1

Re: design question

2010-05-04 Thread Bruno Desthuilliers
Alf P. Steinbach a écrit : (snip) Re efficiency it seems to be a complete non-issue, but correctness is much more important: is there any way that the config details can be (inadvertently) changed while the build is going on? +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: design question

2010-05-03 Thread Alf P. Steinbach
* Tim Arnold: This is a question about system design I guess. I have a django website that allows users to change/view configuration details for documentation builds. The database is very small. The reason I'm using a database in the first place is to make it easy for users to change the configur

Re: design question

2010-05-03 Thread Kev
Tim Arnold wrote: > This is a question about system design I guess. I have a django > website that allows users to change/view configuration details for > documentation builds. The database is very small. The reason I'm using > a database in the first place is to make it easy for users to change >

design question

2010-05-03 Thread Tim Arnold
This is a question about system design I guess. I have a django website that allows users to change/view configuration details for documentation builds. The database is very small. The reason I'm using a database in the first place is to make it easy for users to change the configuration of their b

Re: Design question about pretree classifier

2010-01-04 Thread Aahz
In article , Steve Holden wrote: >Julian wrote: >> >> But: >> >> - none classification: return an exception or None? I think None is >> better, hence its not an exception that there is no classification but >> a defined state. What do you think? >> - many classifications: what to do? retun a se

Re: Design question about pretree classifier

2009-12-18 Thread Julian
On 18 Dez., 18:59, Steve Holden wrote: > Julian wrote: > > Hello, > > > I've got a design problem for a classifier. To make it short: it maps > > strings on strings. > > > Some strings have exactly one classification, some none and some more > > than one. > > > There's a method classify(self, word

Re: Design question about pretree classifier

2009-12-18 Thread Steve Holden
Julian wrote: > Hello, > > I've got a design problem for a classifier. To make it short: it maps > strings on strings. > > Some strings have exactly one classification, some none and some more > than one. > > There's a method classify(self, word) wich classifies a word. For the > first case ther

Design question about pretree classifier

2009-12-18 Thread Julian
Hello, I've got a design problem for a classifier. To make it short: it maps strings on strings. Some strings have exactly one classification, some none and some more than one. There's a method classify(self, word) wich classifies a word. For the first case there's no problem: - one classificat

Re: Design question.

2009-07-20 Thread Dave Angel
Lacrima wrote: On Jul 20, 4:05 pm, Jean-Michel Pichavant wrote: Lacrima wrote: Hello! I am newbie in python and I have really simple question, but I need your advice to know how to do best. I need to store a number of dictionaries in certain place. I've decided to store them in

Re: Design question.

2009-07-20 Thread Marcus Wanner
On 7/20/2009 9:42 AM, Lacrima wrote: On Jul 20, 4:05 pm, Jean-Michel Pichavant wrote: Lacrima wrote: Hello! I am newbie in python and I have really simple question, but I need your advice to know how to do best. I need to store a number of dictionaries in certain place. I've decided to store t

Re: Design question.

2009-07-20 Thread Lacrima
On Jul 20, 4:05 pm, Jean-Michel Pichavant wrote: > Lacrima wrote: > > Hello! > > > I am newbie in python and I have really simple question, but I need > > your advice to know how to do best. > > I need to store a number of dictionaries in certain place. I've > > decided to store them in a separate

Re: Design question.

2009-07-20 Thread Jean-Michel Pichavant
Lacrima wrote: Hello! I am newbie in python and I have really simple question, but I need your advice to know how to do best. I need to store a number of dictionaries in certain place. I've decided to store them in a separate module. Like this: dicts.py --- dict1 = {} dic

Re: Design question.

2009-07-20 Thread Lacrima
On Jul 20, 3:31 pm, "Diez B. Roggisch" wrote: > Lacrima wrote: > > Hello! > > > I am newbie in python and I have really simple question, but I need > > your advice to know how to do best. > > I need to store a number of dictionaries in certain place. I've > > decided to store them in a separate mo

Re: Design question.

2009-07-20 Thread Diez B. Roggisch
Lacrima wrote: > Hello! > > I am newbie in python and I have really simple question, but I need > your advice to know how to do best. > I need to store a number of dictionaries in certain place. I've > decided to store them in a separate module. > Like this: > dicts.py > --- >

Design question.

2009-07-20 Thread Lacrima
Hello! I am newbie in python and I have really simple question, but I need your advice to know how to do best. I need to store a number of dictionaries in certain place. I've decided to store them in a separate module. Like this: dicts.py --- dict1 = {} dict2 = {} dict3

Re: Inheritance and Design Question

2009-05-28 Thread Steven D'Aprano
On Wed, 27 May 2009 17:21:23 -0400, Terry Reedy wrote: > super() was designed for multiple inheritance. Surely you mean that super() was designed for *inheritance*, multiple or singular? Working with single inheritance is part of the design, not an accident of implementation. > The only reaso

Re: Inheritance and Design Question

2009-05-28 Thread Jean-Michel Pichavant
imageguy wrote: I have an object the I would like to use as a base class. Some of the methods I would like to override completely, but others I would simply like to call the base class method and use the return value in the child method. The purpose here is to eliminate the duplication of valua

Re: Inheritance and Design Question

2009-05-27 Thread Carl Banks
On May 27, 12:58 pm, imageguy wrote: > I have an object the I would like to use as a base class.  Some of the > methods I would like to override completely, but others I would simply > like to call the base class method and use the return value in the > child method.  The purpose here is to elimin

Re: Inheritance and Design Question

2009-05-27 Thread Andre Engels
On Wed, May 27, 2009 at 9:58 PM, imageguy wrote: > I have an object the I would like to use as a base class.  Some of the > methods I would like to override completely, but others I would simply > like to call the base class method and use the return value in the > child method.  The purpose here

Re: Inheritance and Design Question

2009-05-27 Thread Terry Reedy
imageguy wrote: I have an object the I would like to use as a base class. Some of the methods I would like to override completely, but others I would simply like to call the base class method and use the return value in the child method. The purpose here is to eliminate the duplication of valua

Re: Inheritance and Design Question

2009-05-27 Thread Matimus
On May 27, 12:58 pm, imageguy wrote: > I have an object the I would like to use as a base class.  Some of the > methods I would like to override completely, but others I would simply > like to call the base class method and use the return value in the > child method.  The purpose here is to elimin

Re: Inheritance and Design Question

2009-05-27 Thread Scott David Daniels
imageguy wrote: I have an object the I would like to use as a base class. Some of the methods I would like to override completely, but others I would simply like to call the base class method and use the return value in the child method. The purpose here is to eliminate the duplication of valua

Inheritance and Design Question

2009-05-27 Thread imageguy
I have an object the I would like to use as a base class. Some of the methods I would like to override completely, but others I would simply like to call the base class method and use the return value in the child method. The purpose here is to eliminate the duplication of valuable code in the pa

Re: design question, metaclasses?

2009-04-14 Thread Piet van Oostrum
> Darren Dale (DD) wrote: >DD> On Apr 11, 2:15 pm, Darren Dale wrote: >>> I am working on a project that provides a high level interface to hdf5 >>> files by implementing a thin wrapper around h5py. I would like to >>> generalize the project so the same API can be used with other formats, >>

Re: design question, metaclasses?

2009-04-12 Thread Aaron Brady
On Apr 12, 4:53 pm, Darren Dale wrote: > On Apr 12, 4:50 pm, Kay Schluehr wrote: > > > > > On 11 Apr., 20:15, Darren Dale wrote: > > > > I am working on a project that provides a high level interface to hdf5 > > > files by implementing a thin wrapper around h5py. > > > I would like to > > > gene

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 12, 4:50 pm, Kay Schluehr wrote: > On 11 Apr., 20:15, Darren Dale wrote: > > > I am working on a project that provides a high level interface to hdf5 > > files by implementing a thin wrapper around h5py. > > I would like to > > generalize the project so the same API can be used with other

Re: design question, metaclasses?

2009-04-12 Thread Kay Schluehr
On 11 Apr., 20:15, Darren Dale wrote: > I am working on a project that provides a high level interface to hdf5 > files by implementing a thin wrapper around h5py. > I would like to > generalize the project so the same API can be used with other formats, > like netcdf or ascii files. The format sp

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 12, 3:23 pm, Aaron Brady wrote: > On Apr 12, 1:30 pm, Darren Dale wrote: > > > > > On Apr 11, 2:15 pm, Darren Dale wrote: > > _ > > > > format1.Group # implementation of group in format1 > > > format2.Group # ... > > > Base.DerivedGroup # base implementation of DerivedGroup, not directly

Re: design question, metaclasses?

2009-04-12 Thread Aaron Brady
On Apr 12, 1:30 pm, Darren Dale wrote: > On Apr 11, 2:15 pm, Darren Dale wrote: > > _ > > > format1.Group # implementation of group in format1 > > format2.Group # ... > > Base.DerivedGroup # base implementation of DerivedGroup, not directly > > useful > > format1.DerivedGroup = Base.DerivedGroup(

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 11, 2:15 pm, Darren Dale wrote: > I am working on a project that provides a high level interface to hdf5 > files by implementing a thin wrapper around h5py. I would like to > generalize the project so the same API can be used with other formats, > like netcdf or ascii files. The format spec

design question, metaclasses?

2009-04-11 Thread Darren Dale
I am working on a project that provides a high level interface to hdf5 files by implementing a thin wrapper around h5py. I would like to generalize the project so the same API can be used with other formats, like netcdf or ascii files. The format specific code exists in File, Group and Dataset clas

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-11 Thread Akira Kitada
Opened a ticket for this and attached a patch. (experimental) http://bugs.python.org/issue5736 On Fri, Apr 10, 2009 at 8:39 AM, "Martin v. Löwis" wrote: I assumed there were some decisions behind this, rather than it's just not implemented yet. >>> I believe this assumption is wrong - i

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Martin v. Löwis
>>> I assumed there were some decisions behind this, rather than it's just >>> not implemented yet. >> I believe this assumption is wrong - it's really that no code has been >> contributed to do that. > > But doesn't the issue at http://bugs.python.org/issue662923 imply that > there *was* suitable

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread andrew cooke
"Martin v. Löwis" wrote: >> I assumed there were some decisions behind this, rather than it's just >> not implemented yet. > > I believe this assumption is wrong - it's really that no code has been > contributed to do that. But doesn't the issue at http://bugs.python.org/issue662923 imply that the

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Martin v. Löwis
> I assumed there were some decisions behind this, rather than it's just > not implemented yet. I believe this assumption is wrong - it's really that no code has been contributed to do that. For gdbm, you can also use the firstkey/nextkey methods. Regards, Martin -- http://mail.python.org/mailma

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread skip
Joshua> Why not Joshua> for key in d.keys(): Joshua> print key Joshua> That worked for me. Time & space. One motivation for using dbm files is to write large (huge, in fact) mappings to disk. Simply reconstituting the entire set of keys may consume a lot of time (they must

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Akira Kitada
keys() returns a list and my question was not about "how to" but more like "why"... I assumed there were some decisions behind this, rather than it's just not implemented yet. Best, On Friday, April 10, 2009, Joshua Kugler wrote: > Akira Kitada wrote: > >> The loop has to be: >> """ > k = d.f

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Joshua Kugler
Akira Kitada wrote: > The loop has to be: > """ k = d.firstkey() while k != None: > ...print k > ...k = d.nextkey(k) > key2 > key1 > """ Why not for key in d.keys(): print key That worked for me. j -- http://mail.python.org/mailman/listinfo/python-list

Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Akira Kitada
Hi, I was wondering why *dbm modules in Python do not give us an iterable interface? Take a look at an example below """ # Python 2.6 >>> import gdbm >>> d = gdbm.open("spam.db", "n") >>> d["key1"] = "ham" >>> d["key2"] = "spam" >>> >>> for k in d: ... print k ... Traceback (most recent call

Re: ftp design question

2008-12-28 Thread nemo
On Dec 29, 12:31 pm, Steve Holden wrote: > nemo wrote: > > Hi,all. > > I'm on a toy ftp project and I want it to be convinient for the user > > to cancel an undergoing downloading while continue others. The > > following code explains: > > for file in download_files: > >     self.ftp.retrbinary('R

Re: ftp design question

2008-12-28 Thread Steve Holden
nemo wrote: > Hi,all. > I'm on a toy ftp project and I want it to be convinient for the user > to cancel an undergoing downloading while continue others. The > following code explains: > for file in download_files: > self.ftp.retrbinary('RETR '+file, fileHandler) > Thers seems not a solid way

ftp design question

2008-12-28 Thread nemo
Hi,all. I'm on a toy ftp project and I want it to be convinient for the user to cancel an undergoing downloading while continue others. The following code explains: for file in download_files: self.ftp.retrbinary('RETR '+file, fileHandler) Thers seems not a solid way to cancel this transfer an

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Steve Holden
Mike D wrote: > Steve, > > You raise some very good (and obvious) issues I did'nt consider. I'll > look further into this sort of implementation as I'm quite interested. > > I suppose a compromise could be to load the objects from a pickle, that > may have issues in terms of updating the pickle

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Mike D
Steve, You raise some very good (and obvious) issues I did'nt consider. I'll look further into this sort of implementation as I'm quite interested. I suppose a compromise could be to load the objects from a pickle, that may have issues in terms of updating the pickle perhaps, though it would be m

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Steve Holden
Mike D wrote: > Steve, > > Thanks for the response. My question really comes down to, as you > suggested, premature optimization. > > It is more for my own understanding than a current practical use. > > If an object is loaded into memory and other threads(or processes) can > recieve a pointer

RE: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Mike D
Steve, Thanks for the response. My question really comes down to, as you suggested, premature optimization. It is more for my own understanding than a current practical use. If an object is loaded into memory and other threads(or processes) can recieve a pointer to this location, would this not

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Steve Holden
Mike D wrote: > Hello, I've just picked up the Python language and am really enjoying it. > > I've just signed up to this mailing list and I'm looking forward to > taking part in some discussions. > > My first post is a question I've been pondering for the last couple of days: > > For relativel

Design question - Sharing of single object by multiple processes

2008-01-30 Thread Mike D
Hello, I've just picked up the Python language and am really enjoying it. I've just signed up to this mailing list and I'm looking forward to taking part in some discussions. My first post is a question I've been pondering for the last couple of days: For relatively static data (such as a list),

Re: Another newbie design question

2007-12-19 Thread John Machin
On Dec 20, 5:00 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Dec 19, 10:48 am, [EMAIL PROTECTED] wrote: > > > This morning block comments disappeared from the Decaf design. Maybe > > later today they'll be instantiated in the tokenizer. > > Out of the idlest of curiousity, does this language ha

Re: Another newbie design question

2007-12-19 Thread Neil Cerutti
On 2007-12-19, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Dec 19, 10:48 am, [EMAIL PROTECTED] wrote: >> This morning block comments disappeared from the Decaf design. >> Maybe later today they'll be instantiated in the tokenizer. > > Out of the idlest of curiousity, does this language have a BNF,

Re: Another newbie design question

2007-12-19 Thread Paul McGuire
On Dec 19, 10:48 am, [EMAIL PROTECTED] wrote: > This morning block comments disappeared from the Decaf design. Maybe > later today they'll be instantiated in the tokenizer. Out of the idlest of curiousity, does this language have a BNF, or some other form of grammar definition? -- Paul -- http:/

Re: Another newbie design question

2007-12-19 Thread MartinRinehart
This morning block comments disappeared from the Decaf design. Maybe later today they'll be instantiated in the tokenizer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
> My 2 cents... Thanks for the feedback, Bruno. Seriously thinking about ditching the block comments and adding multi-line strings. (Block comments are the last item on my tokenizer's "todo" list. Multi-line strings would be easier.) Beginners will be programming fun things in a GUI environment.

Re: Another newbie design question

2007-12-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > I'd like to hear from people who use Python's multi-line strings other > than in doc comments. Then: do you hear me ?-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie design question

2007-12-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Fortran (1957) had line comments. C (1972) replaced these with non- > nested block comments. C++ (1983) added here-to-EOL comments. Python > (1991) keeps here-to-EOL comments but replaces block comments with > multi-line quotes. Block comments and multi-line quotes bot

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
Sion Arrowsmith wrote: > Given a one-or-the-other choice, any editor worth using can do > "comment/uncomment region", and if only to-EOL comments are > available, it will do that for you instead of using block > comments. So block comments are not really a useful language > feature. I'd expect the

Re: Another newbie design question

2007-12-18 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >I've designed a language, Decaf, for beginners. I've got block >comments but not multi-line strings. > >If you can only have one or the other, which is more helpful? Given a one-or-the-other choice, any editor worth using can do "comment/uncomment region", and if only

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
Fortran (1957) had line comments. C (1972) replaced these with non- nested block comments. C++ (1983) added here-to-EOL comments. Python (1991) keeps here-to-EOL comments but replaces block comments with multi-line quotes. Block comments and multi-line quotes both serve the same purpose as doc comm

Re: Another newbie design question

2007-12-17 Thread bambam
Original languages were line oriented, newer languages were block oriented. Original languages has line comments. Newer languages had block comments, and had line comments added back in. So I would read that as line comments being more fundamental, but people who used line comments got so sick of

Re: Another newbie design question

2007-12-17 Thread Bruno Desthuilliers
Patrick Mullen a écrit : > On Dec 17, 2007 1:10 PM, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > >>Hem... May I remind you that Python doesn't have block comments ?-) > > > I suppose we could argue semantics, since """ strings are actually > processed, You guessed !-) > but they are b

Re: Another newbie design question

2007-12-17 Thread Patrick Mullen
On Dec 17, 2007 1:10 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Hem... May I remind you that Python doesn't have block comments ?-) I suppose we could argue semantics, since """ strings are actually processed, but they are basically block comments. So, there we are, multiline strings A

Re: Another newbie design question

2007-12-17 Thread Bruno Desthuilliers
Jim B. Wilson a écrit : > [EMAIL PROTECTED] wrote: > >> If you can only [block comments] or [multi-line strings] the other, >> which is more helpful? > > > I'm afraid no one would use a language that didn't feature block > comments. Hem... May I remind you that Python doesn't have block commen

Re: Another newbie design question

2007-12-17 Thread Jim B. Wilson
[EMAIL PROTECTED] wrote: > If you can only [block comments] or [multi-line strings] the other, > which is more helpful? I'm afraid no one would use a language that didn't feature block comments. However, inspection of a vast corpus of code might lead one to believe that any commenting capabili

Another newbie design question

2007-12-17 Thread MartinRinehart
I've designed a language, Decaf, for beginners. I've got block comments but not multi-line strings. If you can only have one or the other, which is more helpful? Should I have both? (Make a strong argument here: my design principal is, "Designed by a backpacker: when in doubt, leave it out.") --

Re: Class design question

2007-10-03 Thread Wildemar Wildenburger
Adam Lanier wrote: >> class Foo(object): >> def __init__(self, *args): >> self.params = [arg if isinstance(arg, Bar) else Bar(arg) for >> arg in args] >> > > Interesting, I'm not familiar with this idiom... > > These are two idioms actually: 1. a "list comprehension": >>> newlis

Re: Class design question

2007-10-03 Thread Adam Lanier
On Wed, 2007-10-03 at 18:47 +, George Sakkis wrote: > > > > I would use variable argument list for this; it's also consistent with > > your example Foo( 'baz', Bar( 'something else' )), otherwise you need > > to call it as Foo([ 'baz', Bar( 'something else' ) ]) Good point, this is what was tr

Re: Class design question

2007-10-03 Thread George Sakkis
On Oct 3, 2:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 3, 1:04 pm, Adam Lanier <[EMAIL PROTECTED]> wrote: > > > > > Relatively new to python development and I have a general question > > regarding good class design. > > > Say I have a couple of classes: > > > Class Foo: > >

Re: Class design question

2007-10-03 Thread George Sakkis
On Oct 3, 1:04 pm, Adam Lanier <[EMAIL PROTECTED]> wrote: > Relatively new to python development and I have a general question > regarding good class design. > > Say I have a couple of classes: > > Class Foo: > params = [ ] > __init__( self, param ): >

Class design question

2007-10-03 Thread Adam Lanier
Relatively new to python development and I have a general question regarding good class design. Say I have a couple of classes: Class Foo: params = [ ] __init__( self, param ): ... Class Bar: data = None __init__( se

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Paddy
Hi Amit, Why not create a list of those 800+ files and a sccript that when run, looks for an environment variable that will be a number from 1 to 800, selectss the file at that line number and processes it fully. For the process control install a job scheduler such as LSF or the Sun grid Engine ht

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Ivan Voras
Amit N wrote: About 800+ 10-15MB files are generated daily that need to be processed. The processing consists of different steps that the files must go through: -Uncompress -FilterA -FilterB -Parse -Possibly compress parsed files for archival You can implement one of two easy straightforward

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread A.T.Hofkamp
On 2007-09-13, Amit N <[EMAIL PROTECTED]> wrote: > Hi guys, > > I tend to ramble, and I am afraid none of you busy experts will bother > reading my long post, so I will try to summarize it first: I haven't read the details, but you seem to aim for a single python program that does 'it'. A single

Re: Parallel/Multiprocessing script design question

2007-09-12 Thread Martin v. Löwis
> I tend to ramble, and I am afraid none of you busy experts will bother > reading my long post I think that's a fairly accurate description, and prediction. > I am hoping people > with experience using any of these would chime in with tips. The main thing > I would look for in a toolkit is ma

Parallel/Multiprocessing script design question

2007-09-12 Thread Amit N
Hi guys, I tend to ramble, and I am afraid none of you busy experts will bother reading my long post, so I will try to summarize it first: 1. I have a script that processes ~10GB of data daily, and runs for a long time that I need to parallelize on a multicpu/multicore system. I am trying to d

Re: Threaded Design Question

2007-08-10 Thread greg
[EMAIL PROTECTED] wrote: > I ended up taking this route for the most part. The worker thread > first moves the file to be processed into a temp directory, No, the watcher thread should do this itself *before* putting it into the work queue. Then there's no chance of it picking up the same file tw

Re: Threaded Design Question

2007-08-10 Thread half . italian
On Aug 9, 9:45 pm, "Mark T" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if

Re: Threaded Design Question

2007-08-10 Thread Graeme Glass
Using IPC is just adding needles complexity to your program. Instead of constantly scanning the directory for files and then adding them to a Queue, and then having to worry if that specific file may have already been popped off the queue and is currently running by one of the workers, just poll th

Re: Threaded Design Question

2007-08-09 Thread Mark T
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 5:39 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if anyone can point me in the r

Re: Threaded Design Question

2007-08-09 Thread Justin T.
> approach. That sounds the easiest, although I'm still interested in > any idioms or other proven approaches for this sort of thing. > > ~Sean Idioms certainly have their place, but in the end you want clear, correct code. In the case of multi-threaded programming, synchronization adds complexi

Re: Threaded Design Question

2007-08-09 Thread half . italian
On Aug 9, 12:09 pm, "Justin T." <[EMAIL PROTECTED]> wrote: > On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > > Here's how I have it designed so far. The main thread starts a > > Watch(threading.Thread) class that loops and searches a directory for > > files. It has been passed a Queue.Queue() ob

Re: Threaded Design Question

2007-08-09 Thread MRAB
On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch

Re: Threaded Design Question

2007-08-09 Thread Jun-geun Park
[EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch a given directory

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > Here's how I have it designed so far. The main thread starts a > Watch(threading.Thread) class that loops and searches a directory for > files. It has been passed a Queue.Queue() object (watch_queue), and > as it finds new files in the watch folder

  1   2   3   >