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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: Function Point Analysis (FPA) - Equivalent lines of code of Python

2010-09-10 Thread John Roth
th Paul, any global table trying to do that is going to be pretty bogus. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: What the \xc2\xa0 ?!!

2010-09-07 Thread John Roth
tring] = unicode(value, 'UTF-8') > TypeError: decoding Unicode is not supported > > The solution I've arrived at is to specify the encoding for value > strings both when reading and writing value strings. > > for k, v in valuesDict.iteritems(): >     valuePair =

Re: Overload print

2010-08-26 Thread John Roth
> > In [12]: f = Foo() > > In [13]: print f > foo Maybe what the OP really wants is the format() method on a string? That gives a very rich set of override options, at the expense of not using the print statement/method, including the ability to define your own formatting language for a class. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Beyond the moratorium

2010-08-12 Thread John Roth
t;   `\      approaches zero. All non-Free software is a dead end.” —Mark | > _o__)                                                    Pilgrim, 2006 | > Ben Finney You might also want to look at PEP 3152, which was just posted. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Another "Go is Python-like" article.

2010-05-21 Thread John Roth
hey know now. That's not a joke - look at the names on the development team. I haven't a clue how anyone can think it's similar to Python. Or Java, for that matter. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Usable street address parser in Python?

2010-04-18 Thread John Roth
iness. There's a reason why commercial products come with huge data bases -- it's impossible to parse everything correctly with a single set of rules. Those data bases also contain the actual street names and address ranges by zip code, so that direct marketing files can be cleansed to US

Re: Docstrings considered too complicated

2010-02-25 Thread John Roth
ng to take more work to get the point across that comments that reproduce what the method name says are waste. John Roth -- http://mail.python.org/mailman/listinfo/python-list

PEP 3147 - new .pyc format

2010-01-30 Thread John Roth
which object. Summary: I like it, but I think it needs a bit more work. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: power of explicit self?

2009-12-12 Thread John Roth
mpiler. There's a place in the runtime for invoking a method where the object is inserted at the beginning of the parameter list. IIRC, that's done by wrapping the function object. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Go versus Brand X

2009-11-21 Thread John Roth
not all) of the warts removed and some more modern features added. Brought to you by the same people who brought you C and Unix all those years ago. The use of the Plan 9 toolchain is not a coincidence. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to3 does not fix FileType from types Module; no replacement?

2009-03-18 Thread John Roth
x27;re checking for a > file type, you'll want to use isinstance(some_file, io.IOBase). If you're > inheriting form it, I suggest you look at the io module's classes. Nontheless, a warning would be helpful, possibly with some doc. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: English-like Python

2009-01-16 Thread John Roth
ess natural language. The direction that natural language processing has taken in the last 50 years has come up lacking big-time. It does a good job in a single domain, but try to build something that crosses domains and nothing works. There isn't a good alternative in sight John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread John Roth
y. In particular, the decorator problem goes away (the decorators are irrelevant, and can be ignored) and so does the problem with injecting a method into an object. It is, of course, harder to implement, and it would not be backwards compatible because all the internal wrappers vanish as well. That makes problems for anyone who is looking through __dict__ to find particular kinds of method. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: what should we use instead of the 'new' module?

2008-11-13 Thread John Roth
tance, not to a class. As another poster said, an instance method in a class is simply the function object. Static and class methods require wrappers, but those are both built-in functions and they also have decorators. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: rspec for python

2008-08-25 Thread John Roth
them. Compare Rake and Scons - the Ruby and Python embedded DSL build systems that are intended to replace Make, Ant and similar external build DSLs. You can see the difference in fluency. John Roth Python FIT -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggestion: Python global scope

2008-07-15 Thread John Roth
wrong way to go. Finally, as Gerhard Haring has said, it's backward incompatible, so the window for considering it has past: the 3.x series is pretty much frozen. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread John Roth
down the process of the import step by step. There are more productive ways of banging your head against the wall and going insane. In your situation, it might be a whole lot easier to extract a common superclass that both of your classes could inherit from. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 and removal of the 'string' module

2008-07-11 Thread John Roth
d that story around the campfire | > > _o__)                             and nobody got scared.” —Jack Handey | > > Ben Finney > > The PEPs are also a good source; library changes are all listed in PEP 3008. PEP 361 not only gives the schedule but it also gives a lot of detail

Re: How to make a function associated with a class?

2008-07-01 Thread John Roth
t implements it. The general pattern is to get the class for the first operand, check to see if it has the implementation method, and call it if present. If it doesn't, get the class for the other operand, check and if it has the method call it with the operands reversed. Then if it isn't

Re: unittest: Calling tests in liner number order

2008-05-25 Thread John Roth
ecipe ( http://aspn.activestate.com/ASPN/Cookbook/Python/ ) or a note in the documentation with a caveat that it's not good practice, but it may be useful in some circumstances. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest: Calling tests in liner number order

2008-05-23 Thread John Roth
a random permutation as a way of flushing out intertest dependencies. > Does the following patch has a chance of being introduced in the > standard python distribution? I certainly hope not! John Roth Python FIT -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea for P3K

2008-05-07 Thread John Roth
nd ==. I wouldn't mind seeing a way of assigning in the middle of an expression because it comes up fairly frequently when one needs to do a test and save the result at the same time. However I absolutely do not want to see the operator be =. However, if it's not =, then it opens another can of worms, that is, what to call it, and where it fits into the precedence structure. <-- might work. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: str(bytes) in Python 3.0

2008-04-12 Thread John Roth
n that calling str() on a bytes object returns a bytes literal rather than an unadorned character string is that there are no default encodings or decodings: there is no way of determining what the corresponding string should be. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows XP unicode and escape sequences

2007-12-13 Thread John Roth
res You've got two problems. First, you don't need to encode it; if the command prompt window displayed your output after encoding it would display the multi-byte form of your characters. You should just send it a unicode object. Second, check the .encoding attribute of the sys.stdout object. Th

Re: coverage.py: "Statement coverage is the weakest measure of code coverage"

2007-10-29 Thread John Roth
quot;, or "do the tests exercise > the 'no iterations' case for this loop", et cetera. That is, whether > all the functional branches are exercised by tests, not whether the > language is parsed correctly. Since &#

Re: coverage.py: "Statement coverage is the weakest measure of code coverage"

2007-10-28 Thread John Roth
#x27;t have hooks where I need them, and it doesn't have a byte code dedicated to a debugging hook (I think). In other words, the current coverage.py tool is getting the most out of the available hooks: the ones we really need just aren't there. I'd probably opt to rewrite the pr

Re: Python 3.0 migration plans?

2007-09-29 Thread John Roth
http://del.icio.us/steve.holden > > Sorry, the dog ate my .sigline I was thinking of starting work on converting Python FIT to 3.0, and then they posted PEP 3137. I think it's a real good idea, but it shows that 3.0a1 isn't ready for a conversion effort. http://www.python.org/de

Re: Python 3K or Python 2.9?

2007-09-14 Thread John Roth
It would ALSO eliminate a whole level of indirection in method invocation and get rid of the instancemethod, classmethod and staticmethod wrapper classes. This would be a significant simplification. If it had been done earlier, it would have eliminated most of the justification for method attributes (those silly @ things), thus showing that unneeded complexity breeds more unneeded complexity. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Too many 'self' in python.That's a big flaw in this language.

2007-06-27 Thread John Roth
also makes your variable longer. > > >From My point,I think this only help python interpreter to deside > > where to look for. > Is there anyone know's how to make the interpreter find instance name > space first? > Or any way to make programmer's life easier? Guido ha

Re: Looking for an interpreter that does not request internet access

2007-06-25 Thread John Roth
ing the socket in promiscuous mode. Either one will give you that symptom. There are definitely anti-virus products that are that clueless. Scream at the vendor. I doubt if it's Idle, but I'm not in the mood to check the code to see if it's doing it right. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread John Roth
munity. I will most likely emphasize those in my documentation. Providing a method that would translate an arbitrary string into a valid Python identifier would be helpful. It would be even more helpful if it could provide a way of converting untranslatable characters. However, I suspect that the transla

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread John Roth
epended on the default source coding. Fortunately, the fix is (not quite trivially) easy - just scan the library and put the right coding comment in the front. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: SWIG overhead

2007-02-01 Thread John Roth
to dig into the SWIG code before I could figure out what was going on. Bottom line: the c-types module was a lot smaller, in Python, and completely comprehensible. And while I didn't measure the performance, I doubt if it was slower. John Roth -- 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: 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-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: 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: 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: 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: 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: 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: 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: (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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
"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: 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: 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: 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: 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: [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: 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: 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
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
"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
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: 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

  1   2   3   >