Re: super with only one argument

2005-03-14 Thread John Roth
s on the tricky aspects of 'super' you may be interested in. Michele Simionato Wouldn't you use it to access the overridden version of a static method? John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: weird behaviour of "0 in [] is False"

2004-11-30 Thread John Roth
the language definition. That defines both 'in' and 'is' as equality operators, and defines exactly what a chain of equality operators means. In this case, it means: (0 in l) and (l is False) The and short circuits, giving the result of False without ever doing the final compa

Re: [Python-Dev] PEP: __source__ proposal

2004-12-04 Thread John Roth
y effective? While I don't know Smalltalk, the ones I do know indicate that they liked that environment very much. However, this might have real problems with the dangling references issue. Or maybe not: there may be ways of redesigning the function object so that you can replace the embedde

Re: usage of __import__ across two files

2004-12-12 Thread John Roth
rt__('BMTest2') tb2.PrintHello() Shouldn't this be tb.PrintHello() ? [snip] Any help will be much appreciated! Bones John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: lies about OOP

2004-12-13 Thread John Roth
Try comp.object. John Roth "projecktzero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I know this might not be the correct group to post this, but I thought I'd start here. A co-worker considers himself "old school" in that he hasn't seen the li

Re: Why are tuples immutable?

2004-12-17 Thread John Roth
different question. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Maven like tool?

2004-12-18 Thread John Roth
seems quite interesting and has the potential to avoid having to learn several different languages in order to do builds, as well as the possibility to scale well. Martin Fowler has this to say on the subject: http://martinfowler.com/bliki/BuildLanguage.html Besides, it's in pure Python. John

Re: A rational proposal

2004-12-18 Thread John Roth
have limited precision. Rationals can be converted to floats by float(rational), and to integers by int(rational). If this is the case, then there is no reason to have a separate member operation to convert rationals to decimal. Consistency says to do it the same way for all similar operations. ...

Re: Easy "here documents" ??

2004-12-19 Thread John Roth
stly useful in a style of programming that's quite foreign to the way Python wants to be programmed. John Roth Thanks, Jim, Python no0b -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabnanny really useful?

2004-12-20 Thread John Roth
n-aware editors handle the situation reasonably, although you may have to set parameters. John Roth best regards, -- Franz Steinhaeusler -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabnanny really useful?

2004-12-21 Thread John Roth
lt setting without complaining. Otherwise it should complain. John Roth regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional Static Typing

2004-12-23 Thread John Roth
ility into the program to substitute for not having type information, and I found that it was incredibly useful for other things that you can't get from reflection on type data. John Roth Bear hugs, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional Static Typing

2004-12-23 Thread John Roth
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: One of the comments on Artima asks a rather profound question: static typing is an answer. What's the question? (That's a paraphrase.) The answer that everyone seems to give

Re: A Revised Rational Proposal

2004-12-26 Thread John Roth
l doesn't combine with Float either. It should be both or neither. John Roth John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: A Revised Rational Proposal

2004-12-26 Thread John Roth
f Rational to be able to easily access _n and _d. I'd suggest making them public rather than either protected or private. There's a precident with the complex module, where the real and imaginary parts are exposed as .real and .imag. John Roth Thanks again for your work! Steve [1] http://w

Re: Are tuple really immutable?

2004-12-26 Thread John Roth
simply wrong. Since mutating the object didn't change the id, it shouldn't try to replace the object in the tuple. John Roth Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: A Revised Rational Proposal

2004-12-27 Thread John Roth
g floating point string representations. How would that work? I though the divide would be evaluated before the function call, resulting in an exception (strings don't implement the / operator). John Roth -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list

Re: objects as mutable dictionary keys

2004-12-27 Thread John Roth
allow it to be used as a dictionary key. That was their choice, and I pretty much agree with it. John Roth -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.de

Re: objects as mutable dictionary keys

2004-12-28 Thread John Roth
I think that's a good summary. The condensed version is that the results of both __hash__() and __cmp__() have to remain stable for dicts to work as one would expect. __cmp__ doesn't do that for lists, and it isn't defined by default for user objects. John Roth "Peter Maa

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-29 Thread John Roth
lists (operands) and subscripts/slices (operators). Braces ({}) are used for dictionarys (operands). They aren't currently used for unary operators. John Roth Please enlighten me as I really want to know. Chris P.S. I love Python! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-29 Thread John Roth
t pointing arrow would be a vast improvement over the equal sign for assignment, for example. There wouldn't be any chance of mixing it up with the double equal for comparisons. The same thing goes for multiplication and division. We've allowed ourselves to be limited by the ASCII character set for so long that improving that seems to be outside of most people's boxes. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread John Roth
lexer and parser, which currently isn't set up to shift from expression back to statement mode and then return to expression mode. John Roth -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredoman

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread John Roth
"Ian Bicking" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: The syntax I prefer (and I don't know if it's actually been suggested before) is to use braces, that is { and }. In other words, an anonymous function looks like: {p1, p2,

Re: FAQ 1.7.3 : How can I have modules that mutually import each other

2005-03-20 Thread John Roth
onality. Most applications don't require that kind of mess. John Roth "MackS" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi I'm new to Python, I've read the FAQ but still can't get the following simple example working: # file m

Re: problems with  character

2005-03-22 Thread John Roth
I had this problem recently. It turned out that something had encoded a unicode string into utf-8. When I found the culprit and fixed the underlying design issue, it went away. John Roth "jdonnell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a mys

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread John Roth
On the other hand, it saves me an awful lot of hassle; it's one less thing to have to get into my head. John Roth -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: How to organize source code and "import"s???

2005-03-27 Thread John Roth
lass from globals() and make instance. Use the getattr() function. But How can I import all "ExtClass?.py"? Where should I write these import codes? If you want to import all the names in a module, look in the module's __dict__. That's not recommended, however. If you want to im

Re: Overriding methods in classes you don't control

2005-03-27 Thread John Roth
Look up "Aspect Oriented Programming" and Python. You should find several packages that can do this, together with discussions of how to make cuts and all that fun stuff. The feeling of power is very heady - until you have to maintain the resulting mess. John Roth "Alex Vande

Re: Ternary Operator in Python

2005-04-01 Thread John Roth
nd there won't be one unless Guido changes his mind, and that's quite unlikely. There are a number of workarounds; the most used one seems to be based on a feature of the 'and' and 'or' operators. I believe Pep 308 has a summary of the different ways you can do it,

Re: Showing errors explicitly in try... except

2005-04-01 Thread John Roth
ntain the tools to do just about anything you need for error reporting. Also there is a logger module somewhere so you can put the stuff somewhere permanent if you want. John Roth thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: module to parse "pseudo natural" language?

2005-04-17 Thread John Roth
ify other information that must be present, there are a limited number of exchanges, and the number of shares seems to be the only number present. I'd also take a bit of advice from the XP community: don't write the library first, wait until you've got at least three working examples so you know the services that the library really needs to support. John Roth Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-21 Thread John Roth
"praba kar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Dear All, In Python what is equivalent to goto statement Sheesh! It took 20 days for this to get to my mail server! John Roth regards, praba -- http://mail.python.org/mailman/listinfo/python-list

Re: deprecation of has_key?

2005-04-21 Thread John Roth
mething that concerns me overmuch. I don't really worry about a few extra keystrokes; just a whole lot of extra keystrokes. John Roth Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: inserting \ in regular expressions

2011-10-27 Thread John Roth
as a single raw literal.  You'd have to do something > string like >       a = r"strange\literal\with\some\stuff" + "\\" > > My understanding is that no valid regex ends with a backslash, so this > may not affect you. > > -- > > DaveA Dave's answer is excellent background. I've snipped everything except the part I want to emphasize, which is to use raw strings. They were put into Python specifically for your problem: that is, how to avoid the double and triple backslashes while writing regexes. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Design Pattern and Python: Any book recommendation? Your view?

2011-11-04 Thread John Roth
erns book is in the discussion of what the pattern is good for, and what it isn't good for. That is, as another poster says, language agnostic. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: programming with Python 3000 in mind

2006-08-16 Thread John Roth
version program. Most of the rest of the changes seem to be either forward compatable or easily handable by a conversion program. The change in the raise statement, for example, can be handled right now. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on unittest behaviour

2006-08-19 Thread John Roth
able? The same issue applies to staticmethods as well. These are all new since pyUnit (renamed to unittest for inclusion into the standard library) was written. My viewpoint is that it's a feature that's looking for a use case. As I intimated above, my current practice is to not use th

Re: Names changed to protect the guilty

2006-10-07 Thread John Roth
craft.com/ Uh, guys. IMO, the clearest way of writing this is: if key not in schema.elements: whatever... Unless, of course, your code has to run in a Python release earlier than 2.2. But then you wouldn't be testing for the False object anyway. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: (semi-troll): Is Jython development dead?

2006-10-10 Thread John Roth
release requires Python 2.3, and 2.4 will be required in the next year or so. John Roth Python FIT > > > > > > > - Sloan -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing Unicode and string

2006-10-16 Thread John Roth
ime. It's there strictly to guide the compiler in how to compile byte strings. The default encoding at run time is ascii unless it's been set to something else, which is why the error message specifies ascii. John Roth > > TIA for any comments. > > Luc Saffre -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode support in python

2006-10-20 Thread John Roth
ication and centralizing your code! For your other question: the general words are localization and locale. Look up locale in the index. It's a strange subject which I don't know much about, but that should get you started. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: other ways to check for ?

2006-11-02 Thread John Roth
check that case by case, preferably with consultation with your code's clients. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread John Roth
oblems. I've already seen one proposal, and there will undoubtedly be others. If any of them fly, they'll probably be folded into the base in a few years, and that will diminish the ease of use / large project divide between the two languages. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: code is data

2006-06-17 Thread John Roth
eate new control structures with short circuit semantics. And that's one example. I saw the "make" statement as a breath of fresh air. Then it got shot down for what were, to me, totally trivial reasons. That's a second one. Sigh. John Roth > > > Your thoughts please. > > Anton -- http://mail.python.org/mailman/listinfo/python-list

Re: Cycles between package imports

2006-06-18 Thread John Roth
exact order in which things happen and when each object is initialized and shows up in the respective module's namespace. The general rule is: don't do that. It doesn't work, and the hoops you have to go through to force it to work are so complex and bizzare that they're n

Re: Status of optional static typing in Python?

2006-06-23 Thread John Roth
ure may become part of Python? Optional static typing is listed as item # 3 in PEP 3100 (Python 3.0 plans). For a timeline, look at PEP 3000. John Roth > > Thanks very much, > Christian > > > -- > Christian Convey > Computer Scientist, > Naval Undersea Warfare C

Re: Python docs bug

2006-06-29 Thread John Roth
into the manual every time to find it. I wouldn't call it a bug though. I'd call it an example of pedantry over usability. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace Whole Object Through Object Method

2006-07-01 Thread John Roth
be an instant winner in an obfuscated code contest. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: For a fast implementation of Python

2006-07-03 Thread John Roth
't seem to be in PEP 3099, so I suppose the issue is still open. If there was a simple way of using a compiler or language switch in C++ that said: "use garbage collector", then the inherent speed advantage of compiled over interpreted would come through. As it is, C++ simpl

Re: creating multiply arguments for a method.

2006-08-27 Thread John Roth
ing a list of my real parameters as a single parameter is, in most circumstances, easier and IMO clearer. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode string handling problem

2006-09-05 Thread John Roth
s mandated in the unicode standard. If it doesn't have a BOM, then try ascii and utf-8 in that order. The first one that succeeds is correct. If neither succeeds, you're on your own in guessing the file encoding. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPy with a smaller PVM for the full Python?

2006-09-11 Thread John Roth
fast. The same goes for both Java and the CLR (IronPython). I believe there are plans to subset the JVM in the 2.7 release, but I have my doubts whether that will reduce the JVM footprint as far as running Jython is concerned. The intention is to reduce the initial footprint for runing the JVM under a browser. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-13 Thread John Roth
Python 3000". It says: "The parser won't be more complex than LL(1)." He does not want to start down the slippery slope that leads to certain unnamed languages such as Perl. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Isn't bool __invert__ behaviour "strange"?

2006-09-22 Thread John Roth
e boolean results. Since bool is a subclass of int, all the integer operations will remain integer operations. This was done for backwards compatability, and is unlikely to change in the 2.x series. I don't remember if this is supposed to change in 3.0. See PEP 3100 and 3099. John Roth John R

Re: Isn't bool __invert__ behaviour "strange"?

2006-09-23 Thread John Roth
Saizan wrote: > John Roth wrote: > > > The not operator and the bool() builtin produce > > boolean results. Since bool is a subclass of int, > > all the integer operations will remain integer > > operations. This was done for backwards > > compatability,

Re: unicode, bytes redux

2006-09-25 Thread John Roth
ng the string is going to be in various encodings. That's easy enough to do today - just encode the darn thing and use len(). I don't see any reason to expand the language to support a data base product that goes out of its way to make it difficult for developers. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Surprise using the 'is' operator

2006-09-26 Thread John Roth
s? Yes. The topic "The standard Type Hierarchy" in the Language reference specifies this exactly. John Roth > > -- > Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: identifying new not inherited methods

2006-09-27 Thread John Roth
attribute of the class. If all you care about is instance methods (which is all I care about at the moment), they're just ordinary functions. Do an isinstance and you've got it. If you want to dig deeper and look at class methods, static methods, descriptors and other stuff, it's a bit more complicated, but not much. John Roth Python FIT -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin regular expressions?

2006-09-30 Thread John Roth
s a PEP for 3.0 for yet a third library. And guess what? Neither of them uses an operator. > Python Culture says: 'Explicit is better than implicit'. May it be > related to this? It's more "there should be one, and preferably only one, obvious way to do something." John Roth > > Regards, > antoine -- http://mail.python.org/mailman/listinfo/python-list

Re: was python implemented as a object oriented langage at the beginning ?

2006-10-03 Thread John Roth
ts aren't, although most of them can be subclassed. There is actually a decent example of where this is useful: see the rSpec language where they put a method named "should" directly on object, for good reason. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: string: __iter__()?

2006-10-04 Thread John Roth
ing on your program logic, it may be easier to just use iter() and handle the exception if it fails. See PEP 234 for a discussion of the reasons for doing it this way. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Python language extension mechanism for Python 3000... Worth for PEP?

2006-11-30 Thread John Roth
ther point of view, the mechanism can even improve > the backward compatibility of Python 3000 for example by > embeding the Python 2.x interpreter inside and recognition > of the modules written for Python 2.x language version. > The oldness of the legacy module could be recognized by > the Python 3000 interpreter and the module could be passed > to the extension responsible for interpretation of the old > code. PEP 3099 - Things that will not change in Python 3000 says: Python will not have programmable syntax. It seems Guido has made up his mind. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to split up lines - RE: About the 79 character linerecommendation

2006-12-07 Thread John Roth
e on the left, and use the ending parenthesis to get to the last line: (top, ip1, ip2, ip3, ip4, messageCounter, ackRequired, dataType, utc1, utc2, utc3, utc4, utc5, utc6, utc7, utc8, utc9, utc10, utc11, utc12, st1, st2, st3, st4, st5, st6, numberOfLabels, dataWord ) = struct.unpack("!H4BH20BHI", strMessage) John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 Function Annotations for review and comment

2006-12-30 Thread John Roth
ve is a mandatory tie to function/method syntax. Combined with a convention to identify which annotation belongs to who, it could be a quite useful mechanism. I, for one, have no difficulty with the notion of using someone else's annotations if I can identify them unambiguously. John Roth Python FIT -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 Function Annotations for review and comment

2006-12-31 Thread John Roth
;t a current Python implementation that I'm aware of, although I'm thinking of it as a next project. > Thanks for the feedback from everyone so far, I stripped the comment about syntax from this response because I want to address it separately. John Roth > -Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 Function Annotations for review and comment

2006-12-31 Thread John Roth
y have one in any module, class or method. This means you can't always put them where you want them, that is, close to the item that they're annotating. Parenthetically, I'd note that adding docstring capabilities to properties was a definite step forward. John Roth > > Thanks for the feedback from everyone so far, > -Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: Static Methods in Python

2005-05-01 Thread John Roth
on. That niche is better handled by module level functions. You can use real static methods with new style classes, using the staticmethod built in function. However, you can't reference class variables with static methods - you should use class methods to do that. See the Python libra

Re: How to detect a double's significant digits

2005-05-06 Thread John Roth
27;s a niche approach: it works well for FIT's purposes, but it's not a general purpose method of estimating precision throughout a lengthy calculation. That requires quite different techniques. See: fit.c2.com www.fitnesse.org FitNesse Yahoo mailing list (see the files section for PyFit.) John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: hard memory limits

2005-05-07 Thread John Roth
etc. I'd check swap space, and then balance redesigning the application to not try to get large blocks of memory with spending money on more hardware memory that might not solve the problem. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Structuring larger applications - ideas

2005-05-16 Thread John Roth
le bit of scripting goes a long way. Sometimes trying to make an existing tool do something that it's not really right for distorts the entire process, rather than simplifies it. John Roth > > -i > -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing text into dates?

2005-05-16 Thread John Roth
st that they enter it as -mm-dd next time. I don't validate separators. As long as there is something that isn't a number or a letter, it's a separator and which one doesn't matter. At times I've even taken the transition between a digit and a letter as a separator. John Roth > Best regards, > Thomas > -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-21 Thread John Roth
a statement, and then insert a test to make sure that the actual environment matches the expected environment. If it doesn't, it goes back to interpretation for that code segment. John Roth > > Tschö, > Torsten. > > -- > Torsten Bronger, aquisgrana, europa vetus -- http://mail.python.org/mailman/listinfo/python-list

Re: staticmethod and classmethod

2005-05-24 Thread John Roth
e useful when I want to import a class from a module, and don't want to import the module itself or a lot of bits and pieces from the module. The class gives a place to park the method, and also lets you use inheritance, neither of which putting it into the module does. John Rot

Re: __init__() not called automatically

2005-05-26 Thread John Roth
ling with a highly dynamic environment; inspection of the single source module will not tell you enough to make this distinction. John Roth > > Every kind of help would be welcome. > -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread John Roth
world's best practice, but that's another subject.) John Roth > > Thanks, > Elliot > -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread John Roth
all of the real languages out there. Something I heard from one of the people who invented XML is that it originally started out as case insensitive, and they had quite an extensive discussion about it. When they made it case sensitive, one of the basic tools sped up by a factor of three.

Re: distutils, 'scripts' and Windows

2005-05-27 Thread John Roth
well ... Unfortunately, it's also the standard installation engine, so there's no getting around it if you want to be consistent with what everyone else is doing and future enhancements to the installation process through the Python Package Index, eggs and a lot of other stuff that's coming down the pike. John Roth > > Thanks, > George > -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread John Roth
languages, they aren't... Not quite. None, True and False are upper case. John Roth > > -- Elliot Temple > http://www.curi.us/ > > > --- > [This E-mail scanned for viruses by Declude Virus] > -- http://mail.python.org/mailman/listinfo/python-list

Re: String manipulations

2005-05-28 Thread John Roth
f error, then: int(float(numIn) * 100.0) should do the trick. If you can't, and the numbers are guaranteed to have a decimal point, this (untested) could do what you want: aList = numIn.split(".") result int(aList[0]) * 100 + int(aList[1][:2]) HTH John Roth > > Many Thanks, > Lorn > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert string to list or tuple

2005-05-29 Thread John Roth
elif cls in self.oper_types: left = self._safeAssemble(node.left) right = self._safeAssemble(node.right) if type(left) == type(1.0j) or type(right) == type(1.0j): return self.oper_types[cls](left, right) else: raise FitExcep

Re: Is pyunit still usable?

2005-05-30 Thread John Roth
PyUnit came with a GUI, which is not part of the unittest version in the standard library. I don't know whether the GUI from PyUnit still works with the version of unittest in the standard library, but other than that, there is no reason to maintain the PyUnit branch. John Roth "

Re: The need to put "self" in every method

2005-05-31 Thread John Roth
xistance. Also some people use other words than self. (It would, by the way, result in a performance improvement.) 2. There's been some talk of making the '.' operator allow an implied instance. I'm not sure what the status of this is. These two are actually separate issue

Re: prob with ActiveState and FireFox on Win32 (XP and W2K)

2005-06-01 Thread John Roth
so, disable them and see if the problem persists. I certainly don't see it with PythonWin and Firefox. Of course, neither is the latest version, and I have no Firefox extensions. John Roth > > thanks, > > craig > -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode string in exec

2005-06-02 Thread John Roth
a Unicode escape. The result is a Unicode string containing a single Unicode character. In the second example, he's passing a Unicode string to eval(), which string contains a ***normal*** string that contains a Unicode escape. The Unicode escape produces two characters. The result is a ***normal*** string that contains two characters. Is this your problem? John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
rectory. It's almost usable as is; I had to tweak it just a little for what I wanted it to do. John Roth > > --Barry > -- http://mail.python.org/mailman/listinfo/python-list

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
t impractical to use it the way I usually use it. And as Peter said, please cut and paste the complete output, including the command you entered. Thanks. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 and BLT

2005-06-03 Thread John Roth
Could you please expand the BLT acronym. For the life of me, the only thing I associate it with is a Bacon, Lettuce and Tomato sandwich, and I'm sure that's not what you meant. John Roth "Lyddall's" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >

Re: Trouble Encoding

2005-06-07 Thread John Roth
in front of the word MUST is a "smart quote", that is a curly quote, and it is not a valid character in either ASCII or Latin-1. Use Windows-1252 explicitly, and it should render properly. Alternatively use UTF-8, as one of the other posters suggested. Then it's up to whatever software yo

Re: Annoying behaviour of the != operator

2005-06-08 Thread John Roth
he reason for the statement is that the feature was motivated by the numerics package, which has a number of special requirements, floating point exceptional values only being one. Read the PEP. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying behaviour of the != operator

2005-06-08 Thread John Roth
ion is simple chicken squaking, but write the PEP anyway. I'd suggest tightening it to say that if __eq__ is defined, and if neither __ne__ nor __cmp__ is defined, then use __eq__ and return the negation if and only if the result of __eq__ is a boolean. Otherwise raise the current exception. I wouldn't suggest the reverse, though. Defining __ne__ and not defining __eq__ is simply perverse. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: refactoring, unit testing, ant, etc.

2005-06-08 Thread John Roth
without having to design them up front. Doesn't always happen, but it does often enough to be really gratifying. The Python library contains a module named unittest which is the Python equivalent of JUnit etc. I normally run my test suite out of a command line that I keep open while I'm working. I think PyDev in Eclipse has support for it, but since I don't use that I'm not at all sure. John Roth > > Thanks so much! > Dave > -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabnanny?

2005-06-08 Thread John Roth
"Anna M." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thank you so much > and so it goes . . . > > from random import randint > > def idxLargest(list, n): >idxMx = 0 > >for i in range(1, n, 1): > >if list[i] > list[idxMx]: >idxMx = i > >return idx

Re: Abstract and concrete syntax

2005-06-08 Thread John Roth
"David Baelde" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi, > > I tried python, and do like it. Easy to learn and read (at least for the > commonly used part), has a very large community so great doc and > contributions, and... the design is clean. I come from functional > p

Re: Best Web dev language

2005-06-11 Thread John Roth
AJAX, expecially with Google using very script heavy applications for all of their new work. It leads to very responsive web applications. John Roth > > >-- > Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ > Independent WWW/Perforce/FreeBSD/Unix consultant, email for more > information. -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest: collecting tests from many modules?

2005-06-12 Thread John Roth
add them to the suite manually. That has the advantage that one could then select classes according to some parameter. John Roth > > Something like: > > import unittest > import test_foo > import test_bar > > if __name__ == "__main__": > unittest.m

Re: changing how instances are "created"

2005-06-12 Thread John Roth
ease use spaces for indentation. There are a number of popular mail clients that don't play fair with tabs, and people using these clients will frequently ignore code that isn't properly indented. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: changing how instances are "created"

2005-06-12 Thread John Roth
r comment typically > is found in the w*ndows world where everyone is forced into using word > :-) This dead horse has been beaten into a pulp many times. People with newsreaders and mail clients that don't play fair with tabs are not going to change; snide remarks will only reflect on the person making the remark. The major problem is IE, although I've seen other newsreaders and mail clients do the same thing. Also, I don't even have Word on my Windows system; I use Open Office. Being "forced" to use Word is a choice. John Roth > > >> John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use 8bit character sets?

2005-06-13 Thread John Roth
That is the default. As far as I can tell, there are actually two defaults, which tends to confuse things. One is used whenever a unicode to 8-bit conversion is needed on output to stdout, stderr or similar; that's usually Latin-1 (or whatever the installation has set up.) The other is used wh

Re: How to use 8bit character sets?

2005-06-13 Thread John Roth
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: >>> That is the default. >> >> >> As far as I can tell, there are actually two defaults, which tends >> to confuse things. > >

Re: "also" to balance "else" ?

2005-06-13 Thread John Roth
iculty you're having with this is that else is a very bad keyword for this particular construct. I'd prefer something like "on normal exit" as a keyword. John Roth -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >