Re: the meaning of r’.......‘

2012-07-23 Thread John Roth
On Monday, July 23, 2012 1:59:42 AM UTC-6, Chris Angelico wrote: > On Fri, Jul 20, 2012 at 5:56 PM, levi nie wrote: > > the meaning of r’...‘? > > It's a raw string. > > http://docs.python.org/py3k/tutorial/introduction.html#strings > > Chris Angelico Since this

Re: Why doesn't Python remember the initial directory?

2012-08-21 Thread John Roth
s and then look at the __file__ attribute. You need to be a bit careful with this; the import machinery was rewritten for the upcoming 3.3 release, and there were several changes to the module information. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-01-31 Thread John Roth
On Jan 30, 3:43 pm, Terry Reedy wrote: > On 1/30/2012 4:30 PM, Roy Smith wrote: > > > Every so often (typically when refactoring), I'll remove a .py file > > and forget to remove the corresponding .pyc file.  If I then import > > the module, python finds the orphaned .pyc and happily imports it. >

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread John Roth
On Jan 31, 4:43 pm, Terry Reedy wrote: > On 1/31/2012 3:20 PM, John Roth wrote: > > > On Jan 30, 3:43 pm, Terry Reedy  wrote: > >> On 1/30/2012 4:30 PM, Roy Smith wrote: > > >>> Every so often (typically when refactoring), I'll remove a .py file > >

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-24 Thread John Roth
her the > pep or the discussion around it says symlinks are fine now and the > decision is up to distributors. > > -- > Terry Jan Reedy I believe the changes for PEP 394 are using symlinks. The distro maintainer can, of course, change that. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-22 Thread John Roth
pecified for the general case. The id([]) == id([]) thing is a place where cPython's implementation is showing through. It won't work that way in any implementation that uses garbage collection and object compaction. I think Jython does it that way, I'm not sure about either IronPython or PyPy. Third: True and False are reserved names and cannot be assigned to in the 3.x series. They weren't locked down in the 2.x series when they were introduced because of backward compatibility. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3.3 unicode literal and input()

2012-06-18 Thread John Roth
3.x the equivalent of Python 2.x's input() function is eval(input()). It poses the same security risk: acting on unchecked user data. John Roth > jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython: multiple versions on OSX?

2011-07-26 Thread John Roth
might also want to look at PEP 394: http://www.python.org/dev/peps/pep-0394/ It can simplify writing scripts which select the version you want. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Only Bytecode, No .py Files

2011-07-27 Thread John Roth
ry) > open("/etc/ld.so.cache", O_RDONLY)      = 3 > > So can it really be such a huge problem? > > Thomas Two comments. First, your trace isn't showing attempts to open .py files, it's showing attempts to open the Curses library in the bash directory. Maybe you also have a problem with the .py files, but it isn't documented in this trace. It's also not showing the program that's causing the failing open. Second, the audit program is an idiot. There are lots of programs which use the "easier to ask forgiveness" pattern and test for the existence of optional files by trying to open them. This may be what Bash is doing. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Only Bytecode, No .py Files

2011-07-29 Thread John Roth
On Jul 27, 8:56 am, Thomas Rachel wrote: > Am 27.07.2011 14:18 schrieb John Roth: > > > Two comments. First, your trace isn't showing attempts to open .py > > files, it's showing attempts to open the Curses library in the bash > > directory. > > Of c

Re: Why do class methods always need 'self' as the first parameter?

2011-09-01 Thread John Roth
compiler could determine whether a function was an instance or class method. If it then marked the code object appropriately you could get rid of all of the wrappers and the attendant run-time overhead. I've never published the analysis because that train has already left the shed. The earliest

Re: Why do class methods always need 'self' as the first parameter?

2011-09-02 Thread John Roth
On Sep 1, 8:26 am, Ian Kelly wrote: > On Thu, Sep 1, 2011 at 6:45 AM, John Roth wrote: > > I personally consider this to be a wart. Some time ago I did an > > implementation analysis. The gist is that, if self and cls were made > > special variables that returned the curre

Re: Why do class methods always need 'self' as the first parameter?

2011-09-02 Thread John Roth
On Sep 2, 2:30 pm, Ian Kelly wrote: > On Fri, Sep 2, 2011 at 11:51 AM, John Roth wrote: > >> I don't see how you could get rid of the wrappers.  Methods would > >> still need to be bound, somehow, so that code like this will work: > > >> methods

Re: I found some very odd behaviour in Python's very basic types

2011-03-10 Thread John Roth
the way that Python works. Literals are handled during compilation; the built-in types are run-time objects. Python is not a language where a script can change compile-time behavior. Doing that would make it a very different language, and would put it into a very different niche in the language ecology

Re: side by side python

2011-03-23 Thread John Roth
an use Python2 for scripts that require 2.7, and Python3 for scripts that require 3.2, and they'll eventually be portable to other systems. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: running Python2 Python3 parallel concurrent

2011-03-31 Thread John Roth
stems. PEP 397 is a first cut at doing the same thing for Windows. Regards, John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion -- return if true

2011-04-12 Thread John Roth
uldn't want a returnif in a loop. Following on with this idea, loop control would be more of a breakif or continueif statement. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: vertical ordering of functions

2011-05-04 Thread John Roth
order you write things doesn't matter, but there are cases where it really does matter. When it does, you have to have the definition before the use. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: How can engineers not understand source-code control? (was: The Industry choice)

2005-01-03 Thread John Roth
cles/teoseatsoecg/theendofsoftwareengineering.htm His thesis is very simple: engineering took a wrong turn after WW II, and the people who coined the term "software engineering" didn't have a clue. Of course, he puts it a bit more diplomatically, but he's got the data to demonstrate that software engineer

Optional Static Typing: Part II

2005-01-04 Thread John Roth
n favor of the direction Guido seems to be going. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-05 Thread John Roth
g to spend those same months writing a current source to XML translator, and then writing XSLT or more scripts to do the translations to final format, a strategy which would arguably be much more beneficial for the Python community as a whole. The bottom line is that I'm not going to be w

Re: Python Operating System???

2005-01-06 Thread John Roth
hat could be compiled directly to machine code, and start recoding the various C and Asm parts in that. See the PyPy project for the direction they're taking for writing the Python system in Python. Have fun with the project! John Roth Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-07 Thread John Roth
. Going the other way, the word "self" could become a keyword, removing the necessity of specifying it among the method parameters. While I like the idea, there's enough dislike of the notion that it's not going to happen. John Roth -- mvh Björn -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-07 Thread John Roth
uot;self". Using anything else, while legal, is just being different for the sake of being different. Didn't you mean instance method? Class methods are a different beast, and the few examples I've seen seem to use the word "klas". John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread John Roth
un into an application where they need to use it. I think it would be a good idea for the Python team to address decent support for multiprocessors, but I hardly think it is a crisis. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread John Roth
"Donn Cave" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Quoth Skip Montanaro <[EMAIL PROTECTED]>: | | Jp> How often do you run 4 processes that are all bottlenecked on CPU? | | In scientific computing I suspect this happens rather frequently. I think he was trying to say more

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread John Roth
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: I have yet to write a multi-thread program for performance reasons. If we include in the set of things covered by the term "performance" not only throughput, but also latency, t

Re: Python Operating System???

2005-01-08 Thread John Roth
an operating system kernel and can also be converted cleanly to the operating system subset of C, and write a converter that does it. That's the easy part. The hard part is writing the operating system. Look at the (lack of) progress the GNU HURD project has been making recently. John Roth Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Operating System???

2005-01-08 Thread John Roth
ban :-) I should probably get back to it at some stage. As my ex-wife was fond of saying, "I wish you'd have told me it was impossible before I did it." John Roth see http://cleese.sourceforge.net/ James Tauber http://jtauber.com/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-09 Thread John Roth
n Smalltalk but not in Python is that Smalltalk requires the declaration of instance variables. Also Smalltalk does not have things like module variables and builtins. The interpreter knows exactly what every name references, which isn't true in Python. John Roth Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3: on removing map, reduce, filter

2005-01-09 Thread John Roth
that the fastest version uses the array module, and is quite comprehensible - if you know the array module and how it works. It doesn't use the map function. John Roth ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & unicode

2005-01-10 Thread John Roth
It doesn't work because Python scripts must be in ASCII except for the contents of string literals. Having a function name in anything but ASCII isn't supported. John Roth "Michel Claveau - abstraction mÃta-galactique non triviale en fuite perpÃtuelle." <[EMAIL PROTECTED]&

Re: why are people still using classic classes?

2005-01-12 Thread John Roth
anged. Classic classes will go away sometime in the future, currently planned for the semi-mythical 3.0 release. John Roth Sw. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamically inserting function into an object

2005-01-13 Thread John Roth
If what you want is to insert a method into an instance, look at new.instancemethod. John Roth "michael" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, below is a snipplet that could be seen as a part of a spreadsheet with getter and setter properties and a way ho

Re: python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread John Roth
just: it has to work the same on the core platforms, and if anyone else really wants to work on the others, more power to them. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: (objects as) mutable dictionary keys

2005-01-14 Thread John Roth
lso be emphasized that the default instance hash and cmp functions quoted make it impossible for two different instances to compare equal, thus there is no reason to store them as dictionary keys: it's simpler to make the value an attribute of the instance and bypass the additional complexi

Re: PyChecker messages

2005-01-17 Thread John Roth
odenly applying the single exit rule where it doesn't belong frequently winds up creating nested if-elif-else structures and extranious flag variables. If an embedded return isn't clear, the method probably needs to be refactored with "extract method" a few times until it

Re: Assigning to self

2005-01-17 Thread John Roth
tm The first reference contains an example of how to do a singleton: simply search on the word Singleton. John Roth Cheers, Frans -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread John Roth
"Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Monday 17 January 2005 20:03, John Roth wrote: "Frans Englich" <[EMAIL PROTECTED]> wrote in message In other words, you're trying to create a singleton. In general, singletons are

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Roth
irst place I'd look. The postal service has a major interest in having addresses that they can deliver without a lot of hassle. Another place is google. The first two pages using "Address Matching software" gave two UK references, and several Australian references. John Roth -- Andrew McLean -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-18 Thread John Roth
th or without house number), building name and flat or room number that there's a difficulty. We always had a list of keywords that could be trusted to be delimiters. In your examples, "the" should be pretty reliable in indicating a building name. Of course, that might have some trou

Re: QOTW from Ryan Tomayko

2005-01-20 Thread John Roth
cquired taste, and they are one I've never acquired regardless of the environment. I've used both edit under TSO and vi on a timesharing arrangement with an AIX system, and both of them suck compared to the screen editors available. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Next step after pychecker

2005-02-01 Thread John Roth
n find on Google is a blog entry (by Ted Leung) on Aug 30 saying he wished someone would give the author some money to finish it and publish it. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Integrated Testing - Peppable?

2005-02-02 Thread John Roth
e plugins that do this for JUnit; they don't require any changes to Java in order to function. They just require JUnit, which is pretty ubuquitous. Second, is that the IDEs aren't part of Python proper. Outside of that, it's might be quite a good idea to do something similar with unittest, doctest or py.test. John Roth Peace, --Carl -- http://mail.python.org/mailman/listinfo/python-list

Re: Extreme Python

2005-02-04 Thread John Roth
wsgroup or on the regular extremeprogramming list. John Roth PyFIT maintainer. Extremeprogramming mailing list moderator (1 of 7) <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello all, I've created a web/email group for topics related to both Extreme Programming (or othe

See Pep 294. was: Re: Why is there no instancemethod builtin?

2005-06-19 Thread John Roth
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: > >> you need _both_ isinstance and the types module to do a correct >> check for any string type: isinstance(fubar, types.StringTypes). >> That's becaus

See Pep 315. was: Re: Loop until condition is true

2005-06-19 Thread John Roth
See Pep 315, which is still open, and targeted at 2.5. It survived the recent spate of PEP closings and rejections. http://www.python.org/peps/pep-0315.html John Roth "Remi Villatel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there, > > There is

Re: Why is there no instancemethod builtin?

2005-06-19 Thread John Roth
efined for a class that acts like a dictionary: that is, the items are not integers, let alone integers that extend in a strict sequence from 0. John Roth > > George > -- http://mail.python.org/mailman/listinfo/python-list

Re: Using print with format to stdout generates unwanted space

2005-06-19 Thread John Roth
Don't use print, write directly to sys.stdout. Print is not intended for precise output formatting; it's intended for quick outputs that are useable most of the time. John Roth "Paul Watson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > #!/usr/b

Re: need to strip stuff off email

2005-06-21 Thread John Roth
anyone know how to accomplish this? > thanks See the example at the end of the email package documentation. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Does a function like isset() exist in Python?

2005-06-22 Thread John Roth
d trying to print out the values of identifiers on the calling chain on an exception, all bets are off. See the code in the py.test module (part of the PyPy project) for how you can do this. John Roth "Patrick Fitzsimmons" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED

Re: PEP 304 - is anyone really interested?

2005-06-23 Thread John Roth
dows. Actually, the PEP states that if the environment variable does not specify a directory then it does not generate a .pyc file. Any entry that is not a directory would do, such as some special characters that are illegal in file and directory names. John Roth > > Regards, > Pat > -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions on lambda:

2005-06-24 Thread John Roth
s also likely to go away in Python 3.0. Python, for better or worse, is a multi-paradigm language combining the object and procedural paradigms. It is not, and it is not intended to be, a functional style language. John Roth > > For example, the code > > # f = lambda : print "hel

Re: Thoughts on Guido's ITC audio interview

2005-06-25 Thread John Roth
cleanly with a type inferencer, while the index and find methods cannot. [snip] John Roth [1] I'm well aware that ostritches do not stick their heads in the sand to avoid looking at distressing things, such as advancing predators. It is, however, a useful metaphor. > > Cheers, > Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on Guido's ITC audio interview

2005-06-25 Thread John Roth
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 25 Jun 2005 19:31:20 -0600, John Roth wrote: > >> >> "Dave Benjamin" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Gu

Re: Acceptance test spike example

2005-06-26 Thread John Roth
tables: Word processors, Spread Sheets, etc. The Python version of FIT (currently at 0.7a2) can be found in the file section of either the FitNesse Yahoo group or the ExtremeProgramming Yahoo group. One of these days I'm going to get it on PyPi. It's full featured, works both in batch and with FitNesse, and includes most of FitLibrary. There's a book coming out on FIT (FIT for Developing Software) by Rick Mugridge and Ward Cunningham. It was supposed to be out a week ago Friday, but B&N says it was delayed. John Roth PyFit > > Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner question: Converting Single-Element tuples to list

2005-06-27 Thread John Roth
lass emulates > a list, it should do so every time, not only if there is more than one > value in it. Unfortunately, I've seen that behavior a number of times: no output is None, one output is the object, more than one is a list of objects. That forces you to have checks for None and list types all over the place. Granted, sometimes your program logic would need checks anyway, but frequently just returning a possibly empty list would save the caller a lot of grief. John Roth > > Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: Plain text email?

2005-06-27 Thread John Roth
l clients out there that handle tabs poorly. Outlook Express is the poster child for this: it ignores tabs completely, however it is by no means the only culprit. It's simply the most widespread one. In other words, use strings of spaces rather than tabs, and you'll probably fin

Re: Plain text email?

2005-06-27 Thread John Roth
Dan - HTML mail is evil, and I try to avoid it whenever possible. That's one of the major vectors for worms, viri and simliar malware. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: Modules for inclusion in standard library?

2005-06-28 Thread John Roth
that. PyChecker, rather obviously. Likewise I'd like to see something that would do a decent job of coverage analysis. Neither of the modules out there at the moment is ready for prime time. I don't have enough experience with interactive mode to have an opinion on IPython. Wha

Re: Dictionary to tuple

2005-06-28 Thread John Roth
is really new to Python. The (dict.items()) part of the expression returns a list, and if you want to sort it, then you need to sort the list and then convert it to a tuple. dic = {1:'one',2:'two',3:'three'} dic.sort() tup = tuple(dic) This points up the fact that

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread John Roth
one can have for notational expressiveness. While lambda has a lot of problems, Guido seems to be resisting replacing it with something that can actually do the job. Having to define an external function or class doesn't always improve expressiveness. Sometimes it reduces it. To quote

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-02 Thread John Roth
tional constructs has been going on for a long time, and list comprehensions are only one piece of it. John Roth > -- > Robert Kern > [EMAIL PROTECTED] > > "In the fields of hell where the grass grows high > Are the graves of dreams allowed to die." > -- Richard Harter > -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheriting from object

2005-07-02 Thread John Roth
ry class and instance. The big issue seems to be the direction Guido wants to take Python - he seems to not want to put methods on the object type. I have to say that I don't understand his reasoning, if that is indeed his position. John Roth > > Regards, > Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-03 Thread John Roth
es in Python 3.0 See PEP 3000 for details. http://www.python.org/peps/pep-3000.html What this means is that there is a good chance that a print() built-in function or method on a file object may show up in a future release, the print statment won't go away until Python 3.0. John Roth > >

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-04 Thread John Roth
mal numbers, or are they? Because Guido said (somewhere) that he didn't want to go over release 2.9. John Roth > > -- > --- > Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 >

Re: Unicode drives me crazy...

2005-07-04 Thread John Roth
our conversion in the middle will lead to excessive complexity, with the resulting debugging problems. If you do go the unicode route, you must remember that any method or function that's defined to return a string will most likely throw an exception. This includes str()! Whether or not the print statement will work depends on a number of factors in how your Python installation was set up. HTH John Roth > Thanx for help: > ft -- http://mail.python.org/mailman/listinfo/python-list

Re: what is __init__.py used for?

2005-07-05 Thread John Roth
t will have some standard identifiers that all modules have, and second it will have anything you put into the __init__.py module file. This last is an advanced feature, and you're well advised to stay away from it until you've got a lot more experiance. HTH John Roth > > thanks. > -- http://mail.python.org/mailman/listinfo/python-list

Re: removing list comprehensions in Python 3.0

2005-07-09 Thread John Roth
to slice the result, when you want to see a > few elements through repr(), and when you need to loop over the > contents more than once. I was wondering about what seemed like an ill-concieved rush to make everything an iterator. Iterators are, of course, useful but there are times when you really

Re: removing list comprehensions in Python 3.0

2005-07-09 Thread John Roth
ple have made many times, with about as much effect as spitting into the wind. Making a piece of functionality less convenient simply to satisfy someone's sense of language esthetics doesn't seem to me, at least, to be a really good idea. John Roth > > > George > -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-09 Thread John Roth
tively rare, then the try block is the better approach. If you simply want to throw an exception, then the clearest way of writing it that I've ever found is to encapsulate the raise statement together with the condition test in a subroutine with a name that describes what's being tested for. Even a name as poor as "HurlOnFalseCondition(, , , ) can be very enlightening. It gets rid of the in-line if and raise statements, at the cost of an extra method call. John Roth In both approaches, you have some error handling code that is going to clutter up your program flow. -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread John Roth
"optimization." If it runs faster, that's a bonus. It frequently will, at least if you don't add method calls to the process. John Roth > > -- > Thomas > -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-18 Thread John Roth
> Fortunately you can't. Of course you can. Recent versions of Python have the ability to change where an element on the call stack will return to. Don't ask me to debug such a program unless you really want my unvarnished opinion of such stupidity. John Roth > > Mage > -- http://mail.python.org/mailman/listinfo/python-list

!Re: PEP on path module for standard library

2005-07-22 Thread John Roth
sense of dread: nobody has thought out how to do those functions in a useful oo manner. Path looks useable to me. Do I think it's going to be the last word? I sincerely hope not! The only way we're going to find out where it really needs to go from here, though, is to put it out and find o

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: >> "Michael Hoffman" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Many of you are familiar with Jason Orendorff'

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
rner cases file system object (or object hierarchy, etc) has been discussed before, and nothing has ever come of it. Starting with an object that actually does something some people want gives the designers a chance to look at things in the wild. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > John Roth wrote: >> You have to start somewhere. One of the lessons that's beginning >> to seep into people's minds is that getting something that works >> out the

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
s has even less meaning - I can't think of a use, while I have an application where traversing a path as a sequence of path elements makes perfect sense: I need to descend the directory structure, directory by directory, looking for specific files and types. John Roth > > Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-23 Thread John Roth
s to be utterly useless information - at least, I can't imagine a use for it. John Roth > > Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: why functions in modules need 'global foo' for integer foo but not dictionary foo?

2005-07-29 Thread John Roth
bject. so, if you wanted to say: foo = 5 and have it work at the module level, you'd need a global foo statement, while foo["bar"] = "spam" doesn't. The dictionary "foo" isn't rebound, all that's happening is that its state is being changed

Re: Art of Unit Testing

2005-08-02 Thread John Roth
s not always. There are configuration issues that are best dealt with once at the beginning of the test, and once at the end, and that have absolutely nothing to do with the order in which each elementary test runs. When your customers keep asking for something, and you keep telling them that the

Re: Art of Unit Testing (Acceptance Tests)

2005-08-03 Thread John Roth
esting usually does not require expensive setups and teardowns, at least if you're not working on real tangled legacy code. Acceptance testing does. Meanwhile, there's a book and two web sites: fit.c2.com and www.fitnesse.org to look at. John Roth Python Fit > > -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread John Roth
uggested it? > > Is this a candidate for Python 3000 yet? > > Chris A much better idea would be to fix the underlying situation that makes the global statement necessary. I doubt if this is going to happen either, though. John Roth > -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-06 Thread John Roth
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "John Roth" <[EMAIL PROTECTED]> writes: >> <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> A much better idea would be to fix the underl

Re: Fat and happy Pythonistas (was Re: Replacement for keyword 'global' good idea? ...)

2005-08-06 Thread John Roth
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: >> It's not going to happen because the Python community is fat and happy, >> and is not seeing the competition moving up on the outside. >> Characteristics &g

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-06 Thread John Roth
kes that identifier local, so there needs to be a simply way of saying that you want to be able to assign to an identifier in the module namespace. (There's already a more complicated way: use the global() built-in function.) John Roth > Regards Paolino -- http://mail.python.org/mailman/listinfo/python-list

Re: Generalised String Coercion

2005-08-06 Thread John Roth
n the subject. PEP 3000, Core Language, Bullet Point 3: Make all strings be Unicode, and have a separate bytes() type. John Roth > Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Fat and happy Pythonistas (was Re: Replacement for keyword 'global' good idea? ...)

2005-08-06 Thread John Roth
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "John Roth" <[EMAIL PROTECTED]> writes: >> However. I see nothing in the existing Python 3000 PEP that does >> anything other than inspire a yawn. Sure, it's a bunc

Re: python code with indention

2005-02-08 Thread John Roth
ation is not optional. You can, of course, write a silly little inline script without any control structures that will all line up at the left margain. So what? John Roth [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Unittesting for web applications

2005-02-12 Thread John Roth
lunit integration into FIT and Fitnesse. You can frequently get discussions on the Yahoo TDD list. John Roth "Sandip Bhattacharya" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Can someone suggest me some good resources for learning how to use unittests for web applications?

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread John Roth
"Leo Breebaart" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I've tried Googling for this, but practically all discussions on str.join() focus on the yuck-ugly-shouldn't-it-be-a-list-method? issue, which is not my problem/question at all. What I can't find an explanation for is why

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread John Roth
you?) pointed out, this will also work: (untested) result = "".join([str(x) for x in list]) and it's got the advantage that it will handle separators properly. John Roth -- Leo Breebaart <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: introspection inquiry

2005-02-20 Thread John Roth
name of the class the method was defined in. If that's the case, then the inspect module should give the tools to do it without a great deal of angst. Unfortunately, it doesn't give you the class that defined the method, just the class that invoked it. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: PyEphem on Win32 -- 2nd try

2005-02-23 Thread John Roth
find a Windows port compiled with VS 6 or higher. Someone who knows more about those issues will have to take it from here. John Roth <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A second request for help... Has anyone run

Re: Unit testing - one test class/method, or test class/class

2005-02-25 Thread John Roth
es to tell. John Roth "Edvard Majakari" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I just found py.test[1] and converted a large unit test module to py.test format (which is actually almost-no-format-at-all, but I won't get there now). Having 348 test ca

Re: How do I import everything in a subdir?

2005-03-06 Thread John Roth
st or you may be executing a single plugin more than once. Don't bother with sys.path unless you want your plugins to be able to import from that directory as well. John Roth import sys import os sys.path.append("plugins") ls = os.popen("ls plugins").readlines() for x in

Re: Unicode BOM marks

2005-03-08 Thread John Roth
ard vary from Unicode version to Unicode version, but essentially, you are supposed to ignore the BOM if you see it. It would be useful for "super-cat" to filter all but the first one, however. John Roth Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Second argument to super().

2005-03-10 Thread John Roth
c method. Also, when would I pass an object as the second argument, and when would I pass a type? You need to pass the class object when you're calling a class method. While __new__ is technically a static method, for most practical purposes you can regard it as a class method. John Roth Thanks, Tobiah -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread John Roth
x27;t buy the novice arguement. If you want, you can always implement your own print function with a variable number of arguements and just about any semantics you want. John Roth "Marcin Ciura" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Here is a pre-PEP about print

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread John Roth
t the thumbs. That's a reason, but I don't consider it a good reason. I cannot, in fact, think of a single time when I've wanted to enter an octal number. Hex numbers, yes, but not octal. I personally don't think the frequency of use warrents the special case syntax and the res

  1   2   3   >