Re: What's the address for?

2019-02-18 Thread Ben Finney
t containers, and thinking of them that way will frequently lead you to the wrong conclusion. https://nedbatchelder.com/text/names1.html> -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__)

Re: Multiprocessing performance question

2019-02-18 Thread Ben Finney
e you tried using that library and timing the result? -- \ “You don't need a book of any description to help you have some | `\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible | _o__) scholar, 2011-05-08 | Ben Finney -- http

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Ben Finney
purpose:: with foo.open() as logfile: frobnicate_the_whelk(logfile=logfile) -- \ “I don't want to live peacefully with difficult realities, and | `\ I see no virtue in savoring excuses for avoiding a search for | _o__) real answers.” —Pau

Re: Two Tier Cloud Network

2019-02-25 Thread Ben Finney
is to the | _o__) culinary arts.” —Michael Bacarella | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Totally Legit Signing Key?

2019-03-04 Thread Ben Finney
ovenance of the key that made the signature. -- \“Human reason is snatching everything to itself, leaving | `\ nothing for faith.” —Bernard of Clairvaux, 1090–1153 CE | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Not a python question, just programming logic trap?

2019-03-13 Thread Ben Finney
ne by children. | `\ They had all the paintings up on refrigerators.” —Steven Wright | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
sier when the RefrigeratedShippingContainer encapsulates the conversions of temperature units. -- \ “When we pray to God we must be seeking nothing — nothing.” | `\—Francis of Assisi | _o__)

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
Arup Rakshit writes: Michael Torrie writes: > On 03/18/2019 05:55 PM, Ben Finney wrote: > >> If I call `_c_to_f`, `_f_to_c` methods on `self` instead of > >> `RefrigeratedShippingContainer` class object, still it works. > > > > That's right, and is inde

Re: Your IDE's?

2019-03-25 Thread Ben Finney
ex tasks we expect of a programmer's editor like Vim or GNU Emacs. -- \“The reason we come up with new versions is not to fix bugs. | `\ It's absolutely not.” —Bill Gates, 1995-10-23 | _o__)

Re: Your IDE's?

2019-03-27 Thread Ben Finney
is not ignorance but the illusion of | _o__)knowledge.” —Daniel J. Boorstin, historian, 1914–2004 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: configparser - which one?

2019-03-27 Thread Ben Finney
`\ approaches zero. All non-Free software is a dead end.” —Mark | _o__) Pilgrim, 2006 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Ben Finney
ssed before? Too many times to count :-) -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__) | Ben Finney -- https://mail.p

Re: formatted docstrings

2019-04-03 Thread Ben Finney
x27;s going to change depending on the environment). -- \ “Courage is not the absence of fear, but the decision that | `\ something else is more important than fear.” —Ambrose Redmoon | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: convert .py to Android ?

2019-05-14 Thread Ben Finney
imity | `\of the graveyard.” —Justice Roberts in 319 U.S. 624 (1943) | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Instance vs Class variable oddity

2019-05-15 Thread Ben Finney
;s no music, no | `\ choreography, and the dancers hit each other.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Ben Finney
do you need to also have them bound to separate names; what problem are you trying to solve that you think this will help? -- \ “If [a technology company] has confidence in their future | `\ ability to innovate, the importance they place on protecting | _o__) their pas

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Ben Finney
'Banana Split'] The above code produces this output, without any need for binding new names. So what is it you are actually trying to achieve, and why do you think the new bindings are necessary? -- \“The number of UNIX installations has grown to 10, with more | `\ expected.” —Unix Programmer's Manual, 2nd Ed., 1972-06-12 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Reply-To header

2005-10-03 Thread Ben Finney
se: to give the return address for an individual reply to the message author. -- \ "What I resent is that the range of your vision should be the | `\ limit of my action." -- Henry James | _o__)

Re: How to extract a part of html file

2005-10-19 Thread Ben Finney
t would be a good idea." -- Mahatma Gandhi (when | `\asked what he thought of Western civilization) | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Rich __repr__

2005-10-30 Thread Ben Finney
x." -- Gore Vidal | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich __repr__

2005-10-30 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > If I want to implement a __repr__ that's reasonably "nice" to the > programmer, what's the Right Way? Are there recipes I should look > at? As a (carefully selected) example from the code I'm writing:

Re: Rich __repr__

2005-11-01 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Ben Finney wrote: > > > class Human_Sex(str): > > def __repr__(self): > > repr_str = "%s(name=%s)" % ( > >

Re: Rich __repr__

2005-11-01 Thread Ben Finney
Erik Max Francis <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > If I want to implement a __repr__ that's reasonably "nice" to the > > programmer, what's the Right Way? Are there recipes I should look > > at? > > I tend to use: > >

Re: computer programming

2005-11-03 Thread Ben Finney
ing in life is so exhilarating as to be shot at without | `\result." -- Winston Churchill | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

ADT for restricted set of values

2005-11-03 Thread Ben Finney
e way to do what I'm describing? Am I missing a common programming pattern? -- \ "I bought a self learning record to learn Spanish. I turned it | `\on and went to sleep; the record got stuck. The next day I | _o__)could only stutter in Spanish." -- Steven Wright | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: derived / base class name conflicts

2005-11-10 Thread Ben Finney
se who dare not, are slaves." -- "Lord" George | _o__) Gordon Noel Byron | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Abstract Base Classes

2005-11-10 Thread Ben Finney
gs/viewpost.jsp?thread=92662> -- \ "The shortest distance between two points is under | `\ construction." -- Noelie Alito | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract Base Classes

2005-11-10 Thread Ben Finney
value of nothing." -- Oscar Wilde | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: modify dictionary while iterating

2005-11-11 Thread Ben Finney
t;I know the guy who writes all those bumper stickers. He hates | `\ New York." -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Needed class whose instances are many test cases

2005-11-11 Thread Ben Finney
other enemas..." -- Emo Philips | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Needed class whose instances are many test cases

2005-11-11 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Test cases should each run individually, from a known state, and > > not depend on any other tests. You can define a fixture for > > several tests in the unittest.TestCase metho

Re: Python obfuscation

2005-11-12 Thread Ben Finney
| _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding symbols within Python

2005-11-12 Thread Ben Finney
states could be represented in the enumeration, and individual states compared to see if they are "later" that each other. If sequence was not considered important, of course, this feature would not get in the way. -- \ "I put instant coffee in a microwave oven and almost went

Re: Proposal for adding symbols within Python

2005-11-13 Thread Ben Finney
Steven Wright | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding symbols within Python

2005-11-13 Thread Ben Finney
e yet to see a convincing argument against simply assigning values to names, then using those names. -- \ "Yesterday I parked my car in a tow-away zone. When I came back | `\ the entire area was missing." -- Steven Wright | _o__)

Re: Proposal for adding symbols within Python

2005-11-13 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 14 Nov 2005 00:48:46 +1100, Ben Finney wrote: > > I believe Pierre is looking for a syntax that will save him from > > assigning values to names; that Python will simply assign > > arbitrary unique values for th

Re: Proposal for adding symbols within Python

2005-11-13 Thread Ben Finney
Michael <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > I've yet to see a convincing argument against simply assigning > > values to names, then using those names. > > If you have a name, you can redefine a name, therefore the value a > name refers to is mu

Re: Abstract Base Classes

2005-11-13 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > I want my modules to (sometimes) define an abstract base exception > class, that all other exceptions in that module inherit from. Not a whole lot of feedback on this, so here's the implementation I decided upon. class FooEx

Re: Abstract Base Classes

2005-11-13 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > I want my modules to (sometimes) define an abstract base exception > class, that all other exceptions in that module inherit from. [re-posting with the implementation properly foo-ified] Not a whole lot of feedback on this, so here's the

Re: Proposal for adding symbols within Python

2005-11-14 Thread Ben Finney
ctually useful to some amount of users for solving actual problems, that's the time to talk about promoting it. -- \ "I went to the cinema, it said 'Adults: $5.00, Children $2.50'. | `\ So I said 'Give me two boys and a girl.'" -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding symbols within Python

2005-11-14 Thread Ben Finney
onceive that anybody will require multiplications at | `\the rate of 40,000 or even 4,000 per hour ..." -- F. H. Wales | _o__) (1936) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding symbols within Python

2005-11-14 Thread Ben Finney
Homer, _The Simpsons_ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: is parameter an iterable?

2005-11-15 Thread Ben Finney
er-created iterable types that don't inherit from any of the built-in iterable types? -- \ "A good politician is quite as unthinkable as an honest | `\burglar." -- Henry L. Mencken | _o__)

Re: Self terminate a python program

2005-11-15 Thread Ben Finney
t; In this case, 'import sys; help(sys.exit)' will be of assistance. -- \"I always had a repulsive need to be something more than | `\ human." -- David Bowie | _o__)

Re: Shutdown hook

2005-11-15 Thread Ben Finney
ough." -- Bug-Eyed Earl, _Red Meat_ | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Reinvent no more forever

2005-11-15 Thread Ben Finney
oblems in future? [0] http://dirtsimple.org/2005/07/reinvent-no-more-forever.html> [1] Of course, someone already has. I prefer mine to theirs, hence the question. -- \ "I planted some bird seed. A bird came up. Now I don't know | `\

Re: Newb ?

2005-11-15 Thread Ben Finney
tigation takes the place of | `\ sex." -- Gore Vidal | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Reinvent no more forever

2005-11-16 Thread Ben Finney
Fuzzyman <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > On dirtSimple.org[0], PJE wrote: > > > > [...] Python code is easy to write, but hard to depend on. You > > pretty much have to: > > > > 1. limit yourself to platforms

Re: Python obfuscation

2005-11-16 Thread Ben Finney
-- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-16 Thread Ben Finney
next twelve years | _o__) telling them to sit down and shut up." -- Phyllis Diller | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: running functions

2005-11-16 Thread Ben Finney
roblem, however complicated, which, | `\ when you looked at it in the right way, did not become still | _o__) more complicated." -- Paul Anderson | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-16 Thread Ben Finney
evil" away from children. -- \ "Those are my principles. If you don't like them I have | `\ others." -- Groucho Marx | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-16 Thread Ben Finney
The Eternal Squire <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > >Ethics such as sharing, and helping one's neighbour? > > Giving away an illegal copy of software it not helping one's > neighbor, it is making that neighbor an accessory to copyright > infri

Re: JMS yet again

2005-11-16 Thread Ben Finney
es longer." -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Reinvent no more forever

2005-11-17 Thread Ben Finney
Phillip J. Eby <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > - It's just a pretty simple type, with unit tests. Does this > > really justify a PyPI package? > > Yes. Thanks for the brief, but supportive discussion from everyone. I've now packag

Immutable instances, constant values

2005-11-17 Thread Ben Finney
| _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Ben Finney
multiply to create much longer strings. -- \ "Everything is futile." -- Marvin of Borg | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Ben Finney
a filthy lie. Besides, it was only in rats and has not been | _o__) reproduced in humans." -- Linus Torvalds | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Behaviour of enumerated types (was: Re: Immutable instances, constant values)

2005-11-18 Thread Ben Finney
Bengt Richter <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > >I've recently packaged 'enum' in PyPI. > [...] > My notion of enum comes from (what I remember of) Pascal You might want to investigate the 'enum' package for

Re: examining python objects

2005-11-18 Thread Ben Finney
they show whatever information you think is useful for debugging. -- \ "If you go flying back through time and you see somebody else | `\ flying forward into the future, it's probably best to avoid eye | _o__) contact." -- Jack Hand

Re: Adding through recursion

2005-11-18 Thread Ben Finney
comes much easier to read. -- \"If you go to a costume party at your boss's house, wouldn't | `\ you think a good costume would be to dress up like the boss's | _o__) wife? Trust me, it's not." -- Jack Handey | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of enumerated types

2005-11-18 Thread Ben Finney
Bengt Richter <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > >Getting a numeric index might be useful in a language such as > >Pascal, with no built-in dict or sequence types. In Python, where > >any immutable object can be a dict key, and an

Re: Reinvent no more forever

2005-11-19 Thread Ben Finney
[EMAIL PROTECTED] wrote: > Ben Finney wrote: > > How do we deal with the rampant proliferation of a zillion > > implementations of some standard idiom in PyPI? > > How about some kind of "mega util" package? One big package with all > those recurring reinventio

Re: what happens when the file begin read is too big for all lines to be?read with "readlines()"

2005-11-19 Thread Ben Finney
#l2h-244> -- \ "If you're not part of the solution, you're part of the | `\ precipitate." -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of enumerated types

2005-11-19 Thread Ben Finney
Bengt Richter <[EMAIL PROTECTED]> wrote: > On Sat, 19 Nov 2005 11:10:42 +1100 (EST), Ben Finney <[EMAIL PROTECTED]> > wrote: > >Bengt Richter <[EMAIL PROTECTED]> wrote: > >> If [an enumeration has a fixed sequence], what is more natural > >> than u

Re: Immutable instances, constant values

2005-11-19 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote: > > Is there any difference between a Python immutable value, and a > > constant? I suppose "constant" also implies that the *name* binds > > unchangeably

enum 0.2: Enumerations in Python

2005-11-20 Thread Ben Finney
>>> print today.index 2 >>> print today.key tue -- \ "I spilled spot remover on my dog. Now he's gone." -- Steven | `\Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: about dictionary

2005-11-20 Thread Ben Finney
f in the | `\ occurrence of the improbable." -- Henry L. Mencken | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
quot;One of the most important things you learn from the internet | `\ is that there is no 'them' out there. It's just an awful lot of | _o__) 'us'." -- Douglas Adams | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
[restored my attribution line so we know who said what] Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > In what cases do you find yourself needing a dict that preserves > > its key order? Can you present a use case that would be improved > > by

Re: ownership problem?

2005-11-20 Thread Ben Finney
eory that some other fellow has just as little | `\ taste." -- Henry L. Mencken | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
quot;Experience is that marvelous thing that enables you to | `\ recognize a mistake when you make it again." -- Franklin P. | _o__) Jones | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Making immutable instances

2005-11-23 Thread Ben Finney
gence." -- | `\ Henry L. Mencken | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-23 Thread Ben Finney
: File "", line 1, in ? AttributeError: 'int' object has no attribute 'base' Is this a wart? Why? If it's not a wart, why would it be a wart for user-defined types to have the same behaviour? -- \ "I spilled spot remover on my dog. Now he's gone." -- Steven | `\Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-23 Thread Ben Finney
Alex Martelli <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > How can a (user-defined) class ensure that its instances are > > immutable, like an int or a tuple, without inheriting from those > > types? > > You can make a good start by

Re: Making immutable instances

2005-11-23 Thread Ben Finney
Alex Martelli <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > How can a (user-defined) class ensure that its instances are > > immutable, like an int or a tuple, without inheriting from those > > types? > > [...] > Of course, thes

Re: Making immutable instances

2005-11-24 Thread Ben Finney
Alex Martelli <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Why is "I want to make objects immutable" seen as "I don't trust > > my users"? Are Python's existing immutable types also seen the > > same way? I

enum 0.3: Enumerations in Python

2005-11-25 Thread Ben Finney
t can be compared only with other values from the same enumeration, but can be coerced to simple strings matching the original arguments to Enum(). The design is based in part on Zoran Isailovski's recipe, "First Class Enums in Python" in the ASPN Python Cookbook http://aspn.activestate.co

Re: Which License Should I Use?

2005-11-26 Thread Ben Finney
achines to become hackers of those machines; they still all get the benefit of the freedom for anyone they choose to hack on it. -- \ "I have a map of the United States; it's actual size. It says | `\ '1 mile equals 1 mile'... Last summer, I folded it." -- S

Re: interactive prompts

2005-11-27 Thread Ben Finney
r | `\will lose both, and deserve neither." -- Thomas Jefferson, in | _o__) a letter to Madison | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: importing a method

2005-11-27 Thread Ben Finney
gument when called as a method. To do this on an already-defined function, use new.instancemethod. >>> import new >>> help(new.instancemethod) -- \ "One time a cop pulled me over for running a stop sign. He | `\said, 'Didn't you see the stop sign?' I said, 'Yeah, but I | _o__) don't believe everything I read.'" -- Steven Wright | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Which License Should I Use?

2005-11-28 Thread Ben Finney
Maurits Cornelis Escher | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as Guido Intended

2005-11-30 Thread Ben Finney
rutiny, over an extended time, before deciding they'll be a net benefit. -- \ "Unix is an operating system, OS/2 is half an operating system, | `\ Windows is a shell, and DOS is a boot partition virus." -- | _o__) Peter H. Coffin | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-30 Thread Ben Finney
er. You've probably stopped me from writing a bunch of misguided code and realising 5 years too late :-) -- \ "Timid men prefer the calm of despotism to the boisterous sea | `\ of liberty." -- Thomas Jefferson | _o__)

Re: Python as Guido Intended

2005-12-01 Thread Ben Finney
and that is enough for meu. The above should be considered as > an explanation of how understood, not as a correction of how yuo > should have wrote it. An object lesson in taking programmers at their word :-) -- \ "I went to San Francisco. I found someone's heart." --

Re: Making immutable instances

2005-12-01 Thread Ben Finney
g one scoundrel, it appears, does not deter the next. | `\ Well, what of it? The first one is at least disposed of." -- | _o__) Henry L. Mencken | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-12-01 Thread Ben Finney
Mike Meyer <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > Mike Meyer <[EMAIL PROTECTED]> wrote: > >> Lots of people seem to want immutable instances. Nobody seems to > >> have a use case for them. > > Perhaps you m

Re: Making immutable instances

2005-12-01 Thread Ben Finney
Mike Meyer <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > "Since the values of an enumeration are directly reflected in > > the values and attributes, Enum instances are immutable to > > preserve this relationship"

Import path for unit tests

2005-12-02 Thread Ben Finney
ve of several possible ways to get around it, all of which seem hackish to some degree. -- \"It's not what you pay a man, but what he costs you that | `\ counts." -- Will Rogers | _o__)

Re: Import path for unit tests

2005-12-02 Thread Ben Finney
Duncan Booth <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > What is the common idiom here? I can conceive of several possible > > ways to get around it, all of which seem hackish to some degree. > > I don't know if it is the common idiom, but I tend to write

Re: advice : how do you iterate with an acc ?

2005-12-03 Thread Ben Finney
>> acc.flush() Flushing items: ['strawberry'] >>> -- \ "[W]e are still the first generation of users, and for all that | `\ we may have invented the net, we still don't really get it." | _o__) -- Douglas Adams | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Iterating over test data in unit tests

2005-12-05 Thread Ben Finney
sEqual(score, instance.get_score()) self.iterate_test(test_func) That's somewhat clearer; the test function actually focuses on what it's testing. Those layers of indirection are annoying, but they allow the data sets to grow without writing more code to handle them. Testing a rules-based system involves lots of data sets, and each data set represents a separate test case; but the code for each of those test cases is mindlessly repetitive. Factoring them out seems like it needs a lot of indirection, and seems to make each test harder to read. Different *types* of tests would need multiple iterators, more complex test parameter dicts, or some more indirection. Those all sound ugly, but so does repetitively coding every test function whenever some new data needs to be tested. How should this be resolved? -- \ "I never forget a face, but in your case I'll be glad to make | `\ an exception." -- Groucho Marx | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitching about the documentation...

2005-12-05 Thread Ben Finney
"I put instant coffee in a microwave oven and almost went back | `\ in time." -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating over test data in unit tests

2005-12-05 Thread Ben Finney
Scott David Daniels <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > Summary: I'm looking for idioms in unit tests for factoring out > > repetitive iteration over test data > > How about something like: > > > class Test_Game(unittest.TestCase):

Re: Bitching about the documentation...

2005-12-05 Thread Ben Finney
my job the other day. They said my | `\personality was weird. ... That's okay, I have four more." -- | _o__)Bug-Eyed Earl, _Red Meat_ | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating over test data in unit tests

2005-12-05 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > Summary: I'm looking for idioms in unit tests for factoring out > repetitive iteration over test data. Thanks to those who've offered suggestions, especially those who suggested I look at generator functions. This leads to:: impor

Re: subset permutations

2005-12-08 Thread Ben Finney
tters. -- \ "I don't know anything about music. In my line you don't have | `\ to." -- Elvis Aaron Presley (1935-1977) | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating an email address

2005-12-09 Thread Ben Finney
, just deliver the message. -- \ "Those who can make you believe absurdities can make you commit | `\ atrocities." -- Voltaire | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre error from help()

2005-08-09 Thread Ben Finney
| _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

PEP 328, absolute/relative import (was: Re: Bizarre error from help())

2005-08-10 Thread Ben Finney
Peter Hansen <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > Roy Smith <[EMAIL PROTECTED]> wrote: > >>[current-directory module shadowing a system module] > > > > All hail the coming of PEP 328: > > http://www.python.org/peps/pep-0328.ht

<    4   5   6   7   8   9   10   11   12   13   >