Re: Interpreting Left to right?

2011-06-24 Thread Terry Reedy
right." This is the 'other' type of 'multiple assignment' a,b,c = 1,2,3 Order matters here too. a,a[1] = [1,2],3 a # [1,3] # but a[1], a = 3, [1,2] will either fail or modify what a was previously bound to before rebinding a to [1,2]. -- Terry Jan Reedy -- http://ma

Re: what's the big deal for print()

2011-06-24 Thread Terry Reedy
sions, can be passed to functions as an argument, and can have options passed as arguments instead of with terrible syntax hacks. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 syntax error question

2011-06-26 Thread Terry Reedy
ks in Py2 also) or without further change after 2to3. Then encourage author to advertise fact and add Py3 classifier if listed in PyPI. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Bluetooth

2011-06-26 Thread Terry Reedy
t finished? Has the bluetooth spec changed since then? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Default value for optional parameters unexpected behaviour?

2011-06-26 Thread Terry Reedy
e the tutorial says this somewhere too. Read both, along with the first 5 chanpter of the Library reference. If you want code executed when you call the function, put it in the body that is executed when you call the function def f(lst = None): if lst is None: lst = [] ... -- Terr

Re: from module import * using __import__?

2011-07-02 Thread Terry Reedy
On 7/2/2011 12:52 PM, Dan Stromberg wrote: Is there a decent way of running "from import *"? Perhaps using __import__? Does it mean using the copy module or adding an element to globals() somehow? Yes, I think I do have a good use for this: importing either pure python or cython versions of

Re: What makes functions special?

2011-07-09 Thread Terry Reedy
No other objects have code objects. No other objects in Python have this special optimization. A .pyc file is a serialized code object for a module. As for the rest, I am not sure what you are asking. Terry Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What makes functions special?

2011-07-10 Thread Terry Reedy
On 7/9/2011 6:34 PM, Steven D'Aprano wrote: Suppose instead an implementation of Python did not pre-compile the function. Each time you called spam(n), the implementatio n would have to locate the source code and interpret it on the spot. Would that be allowed?" If that's your question, then I

Re: anonymous function with multiple statements

2011-07-10 Thread Terry Reedy
those with individual names. Just use def statements. Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
s, it does not have paid people sitting around writing things to pad numbers to justify a $2k price tag. On the other hand, lots of people have added and made available lots of good add-ons. Mathematica should probably be most fairly compared with Python+numpy+scipy and maybe a few other things.

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
f up are quite sensible and not dumb idiots for preferring 'f(x)' to the '(f x)' of Lisp. In a function call, the function has a different role than the arguments, so it is appropriate that it have a different role in the expression. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write a file generator

2011-07-12 Thread Terry Reedy
e StopIteration def tail(filename): with open(filename, 'rb') as f: while True: yield f.readline() When the caller gets '', it should go and do something else for awhile. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
On 7/12/2011 2:23 PM, gene heskett wrote: Now, I hate to mention it Terry, but your clock seems to be about 126 months behind the rest of the world. Please do not hate to be helpful. It was a bad malfunction perhaps due to a run-down battery on a machine turned off for two weeks. I will keep

Re: Lisp refactoring puzzle

2011-07-13 Thread Terry Reedy
On 7/13/2011 4:29 AM, Teemu Likonen wrote: * 2001-01-01T14:11:11-05:00 * Terry Reedy wrote: As a side note, the same principle of expressions matching operations in symmetry suggest that majority of up are quite sensible and not dumb idiots for preferring 'f(x)' to the '(f x)

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-13 Thread Terry Reedy
ider def myfunc(a, b, c): return a+b+c All indentation was done automatically by IDLE's editor. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-13 Thread Terry Reedy
t e.g. Is there any good example to illustrate the concept? What is the most important features you think I should cover? Functions are first-class objects, like everything else. Use of closures to create functions to be returned. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the difference between PyPy and Python? are there lot of differences?

2011-07-13 Thread Terry Reedy
On 7/13/2011 10:19 AM, Anthony Kong wrote: One of the main difference is that pypy supports only R-Python, which stands for 'Restricted Python". Not true. PyPy is *written* in rpython. It runs standard Python. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: python error PLS-00306: wrong number or types of arguments in

2011-07-13 Thread Terry Reedy
are CPython users. http://sourceforge.net/mail/?group_id=12867 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: json decode issue

2011-07-14 Thread Terry Reedy
uble the backslash in that one particular spot, the string will parse, even if it is not correct. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible File iteration bug

2011-07-14 Thread Terry Reedy
with readline, so it is possible. If above does not work, try (untested): def getlines(f): lines = [] while True: l = f.readline() if l: lines.append(l) else: return lines -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: list(), tuple() should not place at "Built-in functions" in documentation

2011-07-14 Thread Terry Reedy
uilt-in types' section (which could now be called the built-isssn classes section. A more exact title would be 'built-in callables', but that would be even less helpful to newcomers. Callables are functions in the generic sense. In any case, the new index makes it easy to s

Re: None versus MISSING sentinel -- request for design feedback

2011-07-15 Thread Terry Reedy
on a per column basis. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible File iteration bug

2011-07-15 Thread Terry Reedy
r the file. If I call .readline() myself, I forfeit that performance gain. Are you sure? Have you measured the difference? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible File iteration bug

2011-07-15 Thread Terry Reedy
re is no more data for now. a None or other sentinel value would do this as well (as ChrisA already said). A sentinel does provide a work around, but it also passes the problem onto the caller rather than the callee: No more so than a new exception that the caller has to recognize. -- Terr

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Terry Reedy
functool.partial is essential a generic version of makeadder in that it also abstract the function/operator. It is useful when one has a function but perhaps not the source. It's limitation is that args are frozen left to right while the above example freezes the right operand. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-18 Thread Terry Reedy
rtial Function Application -- just a few minutes ago. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Terry Reedy
root = Tk() root.title ("Color Option") app = App(root) root.mainloop() -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: list(), tuple() should not place at "Built-in functions" in documentation

2011-07-19 Thread Terry Reedy
few links that are missing from C.2 to C.5. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: The following modules appear to be missing - py2exe

2011-07-19 Thread Terry Reedy
S\system32\USER32.dll POWRPROF.dll - C:\WINDOWS\system32\POWRPROF.dll SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll ole32.dll - C:\WINDOWS\system32\ole32.dll SHLWAPI.DLL - C:\WINDOWS\system32\SHLWAPI.DLL COMDLG32.DLL - C:\WINDOWS\system32\COMDLG32.DLL ADVAPI32.DLL - C:\WINDOWS\system32\ADVAPI32.DLL msvcrt.dll - C:\WINDOWS\system32\msvcrt.dll WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll WINSPOOL.DRV - C:\WINDOWS\system32\WINSPOOL.DRV GDI32.dll - C:\WINDOWS\system32\GDI32.dll DNSAPI.DLL - C:\WINDOWS\system32\DNSAPI.DLL VERSION.dll - C:\WINDOWS\system32\VERSION.dll KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll IMM32.DLL - C:\WINDOWS\system32\IMM32.DLL COMCTL32.DLL - C:\WINDOWS\system32\COMCTL32.DLL MSIMG32.DLL - C:\WINDOWS\system32\MSIMG32.DLL MPR.dll - C:\WINDOWS\system32\MPR.dll gdiplus.dll - C:\WINDOWS\system32\gdiplus.dll -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Terry Reedy
On 7/19/2011 6:07 AM, Dave Angel wrote: On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote: Dave Angel wrote: On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 = makeadder(2) A couple of typos in that code: def makeaddr(y):

Re: Return and set

2011-07-19 Thread Terry Reedy
nd have getToken use peekToken and then reset. But that depends on the exact logic which depends on the specs. I would more likely have just one function with a reset parameter defaulted to the more common value. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Terry Reedy
Inputs may cause a switch to another state and an output. Another everyday example: a house door can be open, closed, locked, dead-bolted, or both, and maybe barred. There are input actions but no outputs, unless the door is hooked to an alarm system, which is another finite-state system. --

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Terry Reedy
which means they should declare # encoding: utf-8 That is the default in Py3. Not sure of OP specified what he used. or something else fitting, and use os.path.isdir(u"C:/Users/조창준/Desktop/logs/2011-07-03") -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopwatch - pause counter

2011-07-19 Thread Terry Reedy
you should be able to resume pause time. Again, without a design spec, it is hard to know what you intended. Start, Pause, Reset (no obvious effect), Start has same effect. The variables at __init__ self._pausestart = 0.0 self._elapsedpause = 0.0 and the method _updatepause are a attemp

Re: a little parsing challenge ☺

2011-07-19 Thread Terry Reedy
of fences ('(', False), # or exact error output wanted (')', False), # and so on The above could be generated programatically from the set of pairs that should be the input to the program, so that the pairs are not hardcoded into the logic. '([)]', ???), ... ) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Return and set

2011-07-19 Thread Terry Reedy
self.tok = next(self.gen) then this code (and OP's version) should run as is on both Py2.6/7 and Py3. except StopIteration: self.tok = NULL return self.tok def pop(self): token = self.peek() self.tok = None return token -- Terry Jan Reedy --

Re: turtles slowing down

2011-07-19 Thread Terry Reedy
and re-compute loop. I have not specifically looked at your code. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Terry Reedy
on. I think the pyjamas project is aimed in this direction, but the author says he will never port to Py3. (He explained his reasons on this list when I suggested that.) --- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: list(), tuple() should not place at "Built-in functions" in documentation

2011-07-20 Thread Terry Reedy
On 7/20/2011 2:21 AM, Stefan Behnel wrote: Terry Reedy, 19.07.2011 18:31: Chapter 5 is mostly about the behavior of built-in class instances. For some classes, like range, instances only come from class calls and the behavior of instances is intimately tied to the constructor arguments. Having

Re: Convert '165.0' to int

2011-07-21 Thread Terry Reedy
If the domain is int literals followed by '.' and some number of zeroes, then split works. So does int(float(s)). Split also works for non-digits following '.' whereas int(float(s)) does not. If the domain is all float literals, then ??. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-21 Thread Terry Reedy
mal' class for everything else. This could be replaced in Python with a dict 'special' that only maps special characters to their token class and used as "special.get(char, NORMAL)" so that the thousands of normal characters are mapped by default to NORMAL without a humongous ar

Re: PEP 8 and extraneous whitespace

2011-07-21 Thread Terry Reedy
y are intended, the rationale is that lining up does not work with proportional fonts. However, I have IDLE using fixed-space font and I line things up how I want. PEP 8 only applies to new stdlib code. For anything else, it is advisory on a point by point basis. -- Terry Jan Reedy --

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-21 Thread Terry Reedy
py" (could even be a package!) which exports both the zip and tar file classes. However, unlike the current situation this archive module will be consistent with it's API. from archive import ZipFile, TarFile zf = ZipFile(path, *args) tf = TarFile(path, *args) Not a bad idea. P

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
On 7/22/2011 2:40 AM, rantingrick wrote: On Jul 22, 12:45 am, Terry Reedy wrote: Let me give some overall comments rather than respond point by point. Python-dev is a volunteer *human* community, not a faceless corporation, with an ever-changing composition (a very mutable set;-). It is

Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
different people at different times and hence the different apis. I do not know the details of either well enough to know how consistent they could be. You are right that discussing can be a distraction from coding;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert '165.0' to int

2011-07-22 Thread Terry Reedy
er than 18 digits' after 'int literals' to your spec. I was just asking if there were any alternatives. >>> int(s.split('.')[0]) 123456789012345678901 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
On 7/22/2011 5:17 PM, Ned Deily wrote: In article, Terry Reedy wrote: This introduced the problem that upgrading to Python 3 is no longer a single thing. We really need 2to3.1 (the current 2to3), 2to3.2, 2to3.3, etc, but someone would have to make the new versions, but no one, currently, has

Re: learning another programing language

2011-07-24 Thread Terry Reedy
h the inevitable frustration of doing (some) things a much harder way. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Latin Characters

2011-07-24 Thread Terry Reedy
in os.listdir(dir) before joining them to the rootdir and re-encoding. This sort of thing sometimes works better with Python 3. Does someone knows how to fix this? Thank you! João Victor Sousa Jácome -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

python.org back up ?(was Re: python.org is down?)

2011-07-24 Thread Terry Reedy
On 7/24/2011 3:43 AM, Laszlo Nagy wrote: Can it be a problem on my side? I have tried from several different computers. I cannot even ping it. python.org, bugs.python.org, docs.python.org, pypi.python.org all work for me now. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo

Re: I am fed up with Python GUI toolkits...

2011-07-24 Thread Terry Reedy
te people, especially if they have threads collapsed. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: Aw: python.org back up ?(was Re: python.org is down?)

2011-07-25 Thread Terry Reedy
s this one area where windows really wins? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating Entry in tkinter

2011-07-25 Thread Terry Reedy
ther than the entire field after the fact, is it possible to set an onkey handler, that will pass on valid keys? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this overuse a context manager?

2011-07-26 Thread Terry Reedy
it zeallous. The stdlib test code has become zealous on this and other issues as it is intended to be usable by all conforming implementations. We need more zealous people like you to help with tests (and other code) ;-). So I would stick with your style. -- Terry Jan Reedy -- http://mail.pyth

Re: Only Bytecode, No .py Files

2011-07-26 Thread Terry Reedy
one open, which succeeds. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond!

2011-07-26 Thread Terry Reedy
he id of mutables may be critical. Lists of lists is a particular area where id() is really useful. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: seeking an example on C extension works in python 3.1.x or above

2011-07-26 Thread Terry Reedy
layouts are different. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Strings show as brackets with a 'u'.

2011-07-26 Thread Terry Reedy
e-reading. What you need are investigative skills, and not just bits of data. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: NoneType and new instances

2011-07-28 Thread Terry Reedy
On 7/28/2011 5:03 PM, Ethan Furman wrote: I'm glad you asked! I'm using dictionaries to describe fields and what their return values should be. There happen to be two special cases: empty and Null. So a portion of the dictionary looks like: fielddef = { 'empty':some_func, 'null':some_func } De

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Terry Reedy
On 7/29/2011 1:22 PM, rantingrick wrote: * Introduce a new method named "partition" which (along with string splitting methods) will replace the six methods "basename", "dirname", "split", "splitdrive", "splitunc", "splittext". The method will return a tuple of the path split into four parts:

Re: NoneType and new instances

2011-07-30 Thread Terry Reedy
ption is raised by default. .__new__ methods returning the singleton have been added. Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: os.path needs immediate attention!

2011-07-30 Thread Terry Reedy
But having said that, I'm currently writing a library where nearly all the functions violate the No Constant Argument rule. (The API isn't yet stable, so I may still change my mind.) Make of that what you will. See * above ;-). Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Wondering in the Python Forrest

2011-07-30 Thread Terry Reedy
re several packages for adding a graphical user interface to a program. WxPython is one of those. It is the Python wrapper for the wxwidgets library. It is not a 'python' in itself. Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: NoneType and new instances

2011-07-30 Thread Terry Reedy
On 7/30/2011 12:39 PM, bruno.desthuilli...@gmail.com wrote: On 28 juil, 17:39, Ethan Furman wrote: --> bool(0) is bool(0) True This test is not reliable It is in the sense that it will always work -- because False/True are doubletone constants and so documented. But expr is expr == Tr

Re: Early binding as an option

2011-08-02 Thread Terry Reedy
code to native language (or C). The idea of 'early binding' comes up periodically but I do not remember many concrete proposals. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Snippet: The leanest Popen wrapper

2011-08-03 Thread Terry Reedy
ke so cmdline = process.stdout.readline and then, without repeating the attribute lookups, repeatedly call cmdline() . -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: error compiling python, and "plat-linux2" versus "plat-linux3"

2011-08-04 Thread Terry Reedy
There has been some discussion about what to do with 'linux3'. See http://bugs.python.org/issue12326 for example. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Observations on the three pillars of Python execution

2011-08-05 Thread Terry Reedy
within the code. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings and class Attributes

2011-08-08 Thread Terry Reedy
oked up on its class (and superclasses). Since all classes are subclasses of object and that has a docstring, I guess everything will. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Terry Reedy
th getting that to work right on Windows (see issue 12540), but it works well when it does. Depending on your use case, this might work for you too. Communication is through (wrapped) OS pipes, not normal Python file objects. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings and class Attributes

2011-08-08 Thread Terry Reedy
#x27;attribute' Which is to say, the descriptor protocol allows custom get, set, and delete methods, but not an attribute-specific getattribute method ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: smtp

2011-08-08 Thread Terry Reedy
On 8/8/2011 12:26 PM, Chris Angelico wrote: As a side point: Does anyone else feel that it's potentially confusing to have a function whose parameter has the same name as the function itself? This is straight from the example. Yes. I might change it someday when I can. -- Terry Jan

Re: smtp

2011-08-08 Thread Terry Reedy
ython version used and copy *entire* traceback -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: smtp

2011-08-08 Thread Terry Reedy
bug. If this happens with current Python, 2.7.2 or 3.2.1, posting to the bug tracker a minimal example needed to get the above might result in a fix. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Diffs

2011-08-08 Thread Terry Reedy
o idea how stable and local pickles are, but I know they were not designed for diff-ing. Json or yaml representations might do better if applicable. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: just for fun: make a class (not its instances) iterable

2011-08-09 Thread Terry Reedy
(or __dict__.items()) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy/scipy: calculate definite integral of sampled data

2011-08-09 Thread Terry Reedy
numpy/scipy questions are best asked on the numpy/scipy user lists. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: just for fun: make a class (not its instances) iterable

2011-08-09 Thread Terry Reedy
On 8/9/2011 8:29 PM, Tim Chase wrote: On 08/09/2011 07:11 PM, Terry Reedy wrote: On 8/9/2011 5:43 PM, Gelonida N wrote: Now I wondered whether there is any way to implement a class such, that I can write for val in MyClass: print val And what are the items in a class that you expect that to

Re: Python 3.X: nonlocal support in eval/exec?

2011-08-11 Thread Terry Reedy
7;stack of dicts' has nothing to do with how function and nested funcs operate. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-12 Thread Terry Reedy
vel. for... for ... if ... for ... if ... [50 more lines of code] #end outer if [more code] -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: generate and send mail with python: tutorial

2011-08-12 Thread Terry Reedy
dered contributing a HOW-TO? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonw.exe

2011-08-14 Thread Terry Reedy
will open a console window). In particular, IDLE runs in a pythonw process and it executes user code in a separate pythonw process and usually uses a socket for the connection. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem installing 3.2.1 on a Linux server

2011-08-14 Thread Terry Reedy
their concern, of course, but depriving their customers is. supported versions could be deprecated -- and eventually removed by the ISPs, except for the few customers who choose to install it themselves. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-15 Thread Terry Reedy
On 8/15/2011 12:28 AM, Seebs wrote: To repeat again: you are free to put in explicit dedent markers that will let you re-indent code should all indents be removed. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: string to unicode

2011-08-15 Thread Terry Reedy
ect to csv. codecs.open(filename, mode[, encoding[, errors[, buffering]]]) <http://docs.python.org/library/codecs.html#codec-objects> In Python 3, just open with open(... encoding = 'xxx') -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea for pure-python templates using AST.

2011-08-16 Thread Terry Reedy
def body(self, r): ''; self.heading; '' '' for itm in self.items: ''; itm; '' '' The idea is simply to use python ASTs to transform this code so that it accumulates the values of the bare expressions. Interesting idea, though I have no experience for comparison. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux : create a user if not exists

2011-08-16 Thread Terry Reedy
just want to look for a user and if it doesn't exist, an action is taken (create user). Replace if/then with try/except control flow try: pwd.getpwnam(user) return True except KeyWordError: return False -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Terry Reedy
lass/instance attributes can also reuse builtin names. But 'open = ' would be bad. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Terry Reedy
en if suppressed. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Terry Reedy
On 8/16/2011 7:49 PM, Seebs wrote: On 2011-08-16, Terry Reedy wrote: On 8/16/2011 2:56 PM, Seebs wrote: I wonder whether there's a way to mitigate the cost of these things by messing with -W settings, such that runtime that wants to be fast can omit the checks, but the default could sti

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Terry Reedy
On 8/16/2011 8:18 PM, Philip Semanchuk wrote: Hi Terry, To generalize from your example, are you saying that there's a mild admonition > against shadowing builtins with unrelated variable names in standard lib code? I would expect that there might be. I would have to check PEP8. H

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread Terry Reedy
this rare case. --but changing either behavior would be a very bad idea. This proposed syntax would be the Right Way to get separate objects.) It would be very Wrong as it already has a very different meaning. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Wait for a keypress before continuing?

2011-08-17 Thread Terry Reedy
leads to the joke about people searching for the 'any' key ;-). The equivalent contrast for GUIs is "Click OK to continue" versus "Click anywhere to continue" If having to click a specific area is okay for GUIs, having to hit a specific key for TUIs should be also.

Re: List spam

2011-08-18 Thread Terry Reedy
res a response to an email. Uptime is pretty good. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: List spam

2011-08-18 Thread Terry Reedy
7;computer', 'program' or 'language' in the response. 'snake' fails the test. Or 'Enter a Python keyword (search the tutorial if you do not know any) ' -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Word Perfect integration

2011-08-18 Thread Terry Reedy
hon distribution and available on SourceForge. There is a windows module includes in the stdlib, but I do not know if it has enough. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: List spam

2011-08-18 Thread Terry Reedy
, is bogus. Or changed to getting their movies via NetFlix, for instance, as Comcast *is* complaining about. I believe their real complaint is that they are only paid to move bits, and not for originating them, even though they already get several times as much per month as NetFlix. -- Terry

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-21 Thread Terry Reedy
witch-case construct to execute it's opcodes and INPLACE_ADD cames after BINARY_ADD, hence the difference in speed. To be clear, this is nothing you should consider when writing fast code. Complexity wise they both are the same. With 64 bit 3.2.2 on my Win 7 Pentium, the difference was 4%

Re: try... except with unknown error types

2011-08-21 Thread Terry Reedy
went down. Also it's in an embedded box on a customer site. It's not in Antarctica or anything like that, but it's a few towns over, and someone would have to drive there (probably through heavy traffic) if something went wrong that power cycling the box couldn't fix. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-21 Thread Terry Reedy
/* fall through to PRINT_NEWLINE */ add jump to address of the code for PRINT_NEWLINE 1804 1805case PRINT_NEWLINE: must be supported. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

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