How does CO_FUTURE_DIVISION compiler flag get propagated?

2011-07-02 Thread Terry
I've built a Python app for the iPhone, http://www.sabonrai.com/PythonMath/. Like embedding Python in another app, it uses PyRun_SimpleString() to execute commands entered by the user. For evaluating expressions, it uses PyEval_EvalCode() with the dictionary from the __main__ module. Future divis

Re: How does CO_FUTURE_DIVISION compiler flag get propagated?

2011-07-02 Thread Terry
On Jul 2, 3:55 pm, Hrvoje Niksic wrote: > Terry writes: > > Future division ("from __future__ import division") works within > > scripts executed by import or execfile(). However, it does not work > > when entered interactively in the interpreter like this:

.py and .pyc files in read-only directory

2011-10-14 Thread Terry
I'm having a problem with my iPhone/iPad app, Python Math, a Python 2.7 interpreter. All the Python modules are delivered in what Apple calls the app bundle. They are in a read-only directory. This means that Python cannot write .pyc files to that directory. (I get a deny write error when doing thi

Re: .py and .pyc files in read-only directory

2011-10-14 Thread Terry
ic(). I assume this would have to be fixed to try solution 1), i.e., leaving out the .py files and delivering only the .pyc. Terry -- http://mail.python.org/mailman/listinfo/python-list

Python3.0 has more duplication in source code than Python2.5

2009-02-06 Thread Terry
I used a CPD (copy/paste detector) in PMD to analyze the code duplication in Python source code. I found that Python3.0 contains more duplicated code than the previous versions. The CPD tool is far from perfect, but I still feel the analysis makes some sense. |Source Code | NLOC | Dup60

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > > Does that say something about the code quality of Python3.0? > > Not necessarily. IIUC, copying a single file with 2000 lines > completely could already account for that increase. > > It would be interesting to see what specific files have gained > la

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > Terry schrieb: > > > On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > >>> Does that say something about the code quality of Python3.0? > >> Not necessarily. IIUC, copying a single file with 2000

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > Terry schrieb: > > > On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > >>> Does that say something about the code quality of Python3.0? > >> Not necessarily. IIUC, copying a single file with 2000

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > Terry schrieb: > > > On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > >>> Does that say something about the code quality of Python3.0? > >> Not necessarily. IIUC, copying a single file with 2000

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > Terry schrieb: > > > On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > >>> Does that say something about the code quality of Python3.0? > >> Not necessarily. IIUC, copying a single file with 2000

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > Terry schrieb: > > > On 2月7日, 下午3时36分, "Martin v. Löwis" wrote: > >>> Does that say something about the code quality of Python3.0? > >> Not necessarily. IIUC, copying a single file with 2000

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月8日, 上午12时20分, Benjamin Peterson wrote: > Terry gmail.com> writes: > > > On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > > > Do you by any chance have a few examples of these? There is a lot of > > > idiomatic code in python to e.g. acquire and re

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Terry
On 2月8日, 上午8时51分, Terry wrote: > On 2月8日, 上午12时20分, Benjamin Peterson wrote: > > > Terry gmail.com> writes: > > > > On 2月7日, 下午7时10分, "Diez B. Roggisch" wrote: > > > > Do you by any chance have a few examples of these? There is a lot of >

Get all the instances of one class

2008-05-16 Thread Terry
Hi, Is there a simple way to get all the instances of one class? I mean without any additional change to the class. br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: Get all the instances of one class

2008-05-18 Thread Terry
On May 17, 8:04 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 16 May 2008 20:44:00 -0300, Terry <[EMAIL PROTECTED]> > escribió: > > > Is there a simple way to get all the instances of one class? I mean > > without any additional change

Re: Get all the instances of one class

2008-05-18 Thread Terry
On May 17, 8:04 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 16 May 2008 20:44:00 -0300, Terry <[EMAIL PROTECTED]> > escribió: > > > Is there a simple way to get all the instances of one class? I mean > > without any additional change

Re: Get all the instances of one class

2008-05-18 Thread Terry
On May 18, 11:35 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Terry schrieb: > > > > > On May 17, 8:04 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Fri, 16 May 2008 20:44:00 -0300, Terry <[EMAIL PRO

Pyserial - send and receive characters through linux serial port

2008-04-25 Thread terry
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send '%' to serial port and make sure it reached the serial port. 2. Once confirmed, send another character. I

Question regarding Queue object

2008-04-27 Thread Terry
return msg br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: Question regarding Queue object

2008-04-27 Thread Terry
On Apr 27, 6:27 pm, Terry <[EMAIL PROTECTED]> wrote: > Hello! > > I'm trying to implement a message queue among threads using Queue. The > message queue has two operations: > PutMsg(id, msg) # this is simple, just combine the id and msg as one > and put it into

Re: Question regarding Queue object

2008-04-28 Thread Terry
On Apr 28, 5:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > David <[EMAIL PROTECTED]> wrote: > > Another idea would be to have multiple queues, one per thread or per > > message type "group". The producer thread pushes into the appropriate > > queues (through an intelligent PutMsg function)

Re: Question regarding Queue object

2008-04-28 Thread Terry
On Apr 28, 10:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've never used it myself but you may find candygram > interesting;http://candygram.sourceforge.net, which AFAIK implements > Erlang-style > message queues in Python. Thank you. I will look at candygram and stackless. I believ

Re: Question regarding Queue object

2008-04-29 Thread Terry
On Apr 29, 3:01 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 27 Apr 2008 03:27:59 -0700 (PDT), Terry <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > I'm trying to implement a message queue among threads using Queue. The >

Re: Question regarding Queue object

2008-04-29 Thread Terry
On Apr 29, 4:32 pm, [EMAIL PROTECTED] wrote: > On 27 Apr, 12:27, Terry <[EMAIL PROTECTED]> wrote: > > > > > Hello! > > > I'm trying to implement a message queue among threads using Queue. The > > message queue has two operations: > > PutMsg(id, m

Re: Question regarding Queue object

2008-04-29 Thread Terry
On Apr 29, 5:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Terry <[EMAIL PROTECTED]> wrote: > > On Apr 28, 5:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > David <[EMAIL PROTECTED]> wrote: > > > > Another idea w

Re: Pyserial - send and receive characters through linux serial port

2008-05-02 Thread terry
On Apr 26, 8:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-04-25, terry <[EMAIL PROTECTED]> wrote: > > > I am trying to send a character to '/dev/ttyS0' and expect the > > same character and upon receipt I want to send another > &

Re: Pyserial - send and receive characters through linux serial port

2008-05-02 Thread terry
On May 2, 10:26 am, terry <[EMAIL PROTECTED]> wrote: > On Apr 26, 8:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > > > > > On 2008-04-25, terry <[EMAIL PROTECTED]> wrote: > > > > I am trying to send a character to '/dev/ttyS0'

Re: Initializing a subclass with a super object?

2008-05-10 Thread Terry
ory', you will get a lot of examples. br, Terry -- http://mail.python.org/mailman/listinfo/python-list

How to pickle a lambda function?

2009-08-10 Thread Terry
? br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pickle a lambda function?

2009-08-11 Thread Terry
On Aug 11, 3:42 pm, Duncan Booth wrote: > Terry wrote: > > I'm trying to implement something like: > > > remote_map(fun, list) > > > to execute the function on a remove machine. But the problem is I > > cannot pickle a lambda function and send it to

ignored test cases in unittest

2009-08-15 Thread Terry
t seemed the to me that python unittest module does not support the counting of ignored test cases directly. Is there any ready solution for this? br, Terry -- http://mail.python.org/mailman/listinfo/python-list

flatten a list of list

2009-08-16 Thread Terry
Hi, Is there a simple way (the pythonic way) to flatten a list of list? rather than my current solution: new_list=[] for l in list_of_list: new_list.extend(l) or, new_list=reduce(lambda x,y:x.extend(y), list_of_list) br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: ignored test cases in unittest

2009-08-16 Thread Terry
On Aug 16, 5:25 pm, Duncan Booth wrote: > Ben Finney wrote: > > Terry writes: > > >> It seemed the to me that python unittest module does not support the > >> counting of ignored test cases directly. Is there any ready solution > >> for this? > >

Re: flatten a list of list

2009-08-16 Thread Terry
On Aug 16, 6:59 pm, Chris Rebert wrote: > On Sun, Aug 16, 2009 at 6:49 AM, Steven > > > > > > D'Aprano wrote: > > On Sun, 16 Aug 2009 05:55:48 -0400, Chris Rebert wrote: > >> On Sun, Aug 16, 2009 at 5:47 AM, Terry wrote: > >>> Hi, > > >

Re: multiprocessing managers and socket connection.

2009-08-25 Thread Terry
How can I have B automatically reconnect to A and continue its work > once A is available again? I think you need to retry repeatedly until successfully connected. br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Return value of multiprocessing manager registerred function

2009-08-25 Thread Terry
need the value, not the proxy. Can I just return the value instead of a proxy from a manager? br, Terry -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of multiprocessing manager registerred function

2009-08-31 Thread Terry
On Aug 31, 5:58 pm, jacopo wrote: > Hi Terry, > I have just started working on similar things and I am strugling to > find examples or documentations. So far I have found only the official > documentation of the multiprocessing package. Would you be able to > recommend me some good

Re: multiprocessing managers and socket connection.

2009-08-31 Thread Terry
On Aug 26, 7:25 pm, Chris wrote: > On Aug 25, 9:11 pm, Terry wrote: > > > > > > > On Aug 25, 10:14 pm, Chris wrote: > > > > I've been using multiprocessing managers and I really like the > > > functionality. > > > > I have

$$Nike shoes wholesale\retail

2010-10-16 Thread Terry
$$Nike shoes wholesale\retail Our company mainly deal with the import and export of the brand sports shoes, clothes, bags , glasses, etc . Products such as Nike Jordan sell well in America , Canada , as well as Europe and other countries. Our objective is to supply products of first-class quality

Re: Split a list into two parts based on a filter?

2013-06-12 Thread Terry Reedy
te: for s in songs: (new_songs if s.is_new() else old_songs).append(s) No. That succinctly expresses and implements the idea 'append each song to one of two lists. or even: for s in songs: the_right_list = new_songs if s.is_new() else old_songs the_right_list.append(s)

Re: Split a list into two parts based on a filter?

2013-06-12 Thread Terry Reedy
new() else old_songs).append(s) simply ignores the None return of the appends. Since it does not yield None over and over, no extra code is needed to ignore what should be ignored in the first place. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: .mat files processing in Python

2013-06-12 Thread Terry Reedy
On 5/27/2013 4:43 PM, Romila Anamaria wrote: I am beginner in Python programming and I want to make an application Please post plain test only, not html (with a font size too small to read ;-). Don't send attachments, especially not 2 MB files. -- Terry Jan Reedy -- http://mail.pytho

Re: Pywart: The problem with "Rick Johnson"

2013-06-12 Thread Terry Reedy
casionally enjoys verbal jousting, as in a bar, but pollutes his rants with ad hominem slurs. In other words, your subject line was funny, as a spot on parody of his subject lines. Your content was, to me, not funny, and missed the mark. -- Terry Jan Reedy -- http://mail.python.org/mailma

Re: Version Control Software

2013-06-13 Thread Terry Reedy
ve a decent reputation for Mercurial (and is at least somewhat cross-platform). I use the tortoisehg context menus and HgWorkbench (gui access) and am mostly happy with it. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Search Regular Expression

2013-06-15 Thread Terry Reedy
d practice and experiment. Expect to fail 20 times and you should beat your expectation ;-). The interactive interpreter, or Idle with its F5 Run editor window, makes experimenting easy and (for me) fun. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Timsort in Cpython

2013-06-15 Thread Terry Reedy
On 6/15/2013 4:21 PM, alphons...@gmail.com wrote: Well. I'm going to have a ton of fun trying to make sense of this. http://hg.python.org/cpython/file/default/Objects/listsort.txt is pretty clear (to me) for most of the basics. -- Terry Jan Reedy -- http://mail.python.org/mailman/lis

Re: Fatal Python error: Py_Initialize: can't initialize sys standard streams

2013-06-15 Thread Terry Reedy
under the ',' (and perhaps it once was ;-). If really at the beginning of the line, then the error must be on the previous line. Even then, the examples I have tried point to the 'e' or 'raise'. Take a look in the file. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-16 Thread Terry Reedy
n is 84110. Windows says that my cpython clone has about 1400 folders, 15000 files, and 500 million bytes -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-16 Thread Terry Reedy
e Size and 'Size on disk', in both (KB or MB) and bytes. The block size for the disk I am looking at is 4KB, so the Size on disk in KB is a multiple of that. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-17 Thread Terry Reedy
ike a name to that memory location, yes? Instead of accessing a memory address with a use of an integer like "14858485995" we use 'a' instead. So is it safe to say that in Python a == &a ? (& stands for memory address) is the above correct? When you interpret Python c

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-17 Thread Terry Reedy
On 6/17/2013 1:17 PM, Νίκος wrote: On Mon, Jun 17, 2013 at 8:55 AM, Simpleton wrote: On 17/6/2013 5:22 μμ, Terry Reedy wrote: When you interpret Python code, do you put data in locations with integer addresses? I lost you here. Memory in biological brains is not a linear series of bits

Re: decorator to fetch arguments from global objects

2013-06-18 Thread Terry Reedy
db is None: db = fetch_from_global() if isinstance(db, dbclass): save_it() else: raise ValueError('need dbobject') -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: os.putenv() has no effect

2013-06-18 Thread Terry Reedy
http://bugs.python.org/issue1159 > or what I could be doing wrong? Using putenv(key, value) instead of os.environ[key] = value, which suggests that you did not read the full doc entry, which says to use the latter ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is regex so slow?

2013-06-18 Thread Terry Reedy
pieces are less than or equal to 64, rather than splitting all the way down to 1 or 2". -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: collecting variable assignments through settrace

2013-06-18 Thread Terry Reedy
auses the locals dict to be updated with each line, so you do not actually have to have to call locals() with each line. However, that would mean you have to make copies to compare. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Extensions for Python 3 in C

2013-06-19 Thread Terry Reedy
elaborate about calls and implementation. Let Cython take care of the 'calls and implementation' while you write in extended Python. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: decorator to fetch arguments from global objects

2013-06-19 Thread Terry Reedy
On 6/19/2013 4:03 AM, Wolfgang Maier wrote: Wolfgang Maier biologie.uni-freiburg.de> writes: andrea crotti gmail.com> writes: 2013/6/18 Terry Reedy udel.edu> Decorators are only worthwhile if used repeatedly. What you specified can easily be written, for instance, as def sa

Re: A Beginner's Doubt

2013-06-19 Thread Terry Reedy
e side menu. Save option -> Prompt for file and user's name -> Prompt if users want printed copy or not -> Print -> After saved, display random slideshow in other monitor, device or screen with the users' creations. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Does upgrade from 2.7.3 to 2.7.5 require uninstall?

2013-06-20 Thread Terry Reedy
possible to remove the regressions. Hence 2.7.4 was quickly replaced by 2.7.5 (and same for recent 3.2 and 3.3 releases). (Such regressions, as with any bug, expose deficiencies in the test suite, which also get corrected.) I presume that *nix package managers also replace, but have not used

Re: n00b question on spacing

2013-06-21 Thread Terry Reedy
ongoDB database %s/%s" %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider) The point is to not look like a normal indent to clue reader that these are continuation lines and not new statements. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: n00b question on spacing

2013-06-23 Thread Terry Reedy
ile grepping, I just changed the summary line 'Found %d hit%s' to 'Hits found: %d' to avoid the pluralization problem (even though the language is just English for now). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this PEP-able? fwhile

2013-06-25 Thread Terry Reedy
while condition(): block() else: finish() is equivalent to while True: if condition(): block() continue else: finish() break -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: re.finditer() skips unicode into selection

2013-06-26 Thread Terry Reedy
o not understand output, simplify code to see what changes. Separating re issues from framework issues is a big step in that direction. ? What might be the issue. I am new to PyQt and regex. Im using Python 2.7 and PyQt4. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Terry Reedy
y 'I did not really mean required, in the usual mean of that term.'. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Terry Reedy
On 6/27/2013 2:18 PM, Dave Angel wrote: On 06/27/2013 02:05 PM, Terry Reedy wrote: On 6/27/2013 8:54 AM, Andrew Berg wrote: I've begun writing a program with an interactive prompt, and it needs to parse input from the user. I thought the argparse module would be great for this,

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Terry Reedy
ot remember it this was always true for old enough Pythons. ('len = ', 100, 'sum = ', 247, 'prod = ', 0, 'max = ', 4, 'min = ', 1) ('len = ', 100, 'sum = ', 230, 'prod = ', -4611686018427387904, 'max = ', 4,

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Terry Reedy
ystemExit), but argparse was considered an exception because its purpose is to turn a module into an app. With the responses I have seen here, I agree that this is a bit short-sighted, as inflexible behavior. The tracker issue could use more review and comment. -- Terry Jan Reedy -- http://mail.pyt

Re: MeCab UTF-8 Decoding Problem

2013-06-29 Thread Terry Reedy
- (program exited with code: 1) Press return to continue Also my terminal is able to display Japanese characters properly. For example print '日本語' works perfectly fine. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: MeCab UTF-8 Decoding Problem

2013-06-29 Thread Terry Reedy
On 6/29/2013 11:32 AM, Terry Reedy wrote: I am trying to use a program called MeCab, which does syntax analysis on Japanese text. It is generally nice to give a link when asking about 3rd party software. https://code.google.com/p/mecab/ In this case, nearly all the non-boilerplate text is

Re: Closures in leu of pointers?

2013-06-29 Thread Terry Reedy
ually bad style. Writing code that looks functional but is buggy is worse. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread Terry Reedy
On 6/29/2013 5:21 PM, Ian Kelly wrote: On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy wrote: # The alternative for either program or people is a 1-pass + backtracking process where all understandings are kept provisional until the end of the body and revised as required. 2 passes are simpler

Re: Closures in leu of pointers?

2013-06-29 Thread Terry Reedy
that one should not have to scan. The doc string, which should be present should start 'Return a generator that yields ...' or even 'Generate ...'. Of course, then non-generator functions should not start the same way. The first option should be non-ambiguous. --

Re: Python list code of conduct

2013-07-02 Thread Terry Reedy
rmation, like which systems or which versions have the problem. 6. If you make an informed post to the tracker backed up by at least opinion, at least one tracker responder be in a better mode when responding. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Important features for editors

2013-07-05 Thread Terry Reedy
of them, I'll be happy. This is not to mention free Python and LibreOffice as my primary work programs - suppported by hg, TortoiseHg, 7zip, and others. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: analyzing time

2013-07-05 Thread Terry Reedy
ems tricky... Yes -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple recursive sum function | what's the cause of the weird behaviour?

2013-07-06 Thread Terry Reedy
Do the asserts match your intention? The tests amount to a specification by example. Any 'kind' of input that is not tested is not guaranteed to work. Back to the except clause: only add try..except xxx when needed to pass a test. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Explain your acronyms (RSI?)

2013-07-06 Thread Terry Reedy
hronic syndromes. So I still do not know what the original poster, as quoted by Skip, meant. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Editor Ergonomics [was: Important features for editors]

2013-07-09 Thread Terry Reedy
ct on any one of them. That's the system I've adopted. I use the mouse lefty all day when working and righty all night when playing. Me too, more or less. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Stack Overflow bans Mats Peterson (was Re: ....)

2013-07-10 Thread Terry Reedy
anning. So are subterfuges like phrasing banned topics as questions. Given your behavior here, I am 90+% sure animuson's action was appropriate. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive class | can you modify self directly?

2013-07-10 Thread Terry Reedy
have definition names (.__name__ attributes) that are used in their representations (as in tracebacks). But they have no knowledge of their namespace names. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Terry Reedy
. Thanks for the link. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding other people's code

2013-07-12 Thread Terry Reedy
the last week or two settling in, trying to get my head around Python and the way in which this code works. If the functions are not documented in prose, is there a test suite that you can dive into? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Beazley 4E P.E.R, Page29: Unicode

2013-07-14 Thread Terry Reedy
just as modulated sine waves can carry any analog information. In both cases, one can regard them as either purely what they are or as encoding information in some other form. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Timing of string membership (was Re: hex dump w/ or w/out utf-8 chars)

2013-07-14 Thread Terry Reedy
prior to doing the search? I would not make any assumptions about what Python does or does not do without checking the code. All I know is that Python uses a modified version of one of the pre-process and skip-forward algorithms (Boyer-Moore?, Knuth-Pratt?, I forget). These are designed to work efficiently with needles longer than 1 char, and indeed may work better with longer needles. Searching for an single char in n chars is O(n). Searching for a len m needle is potentially O(m*n) and the point of the fancy algorithms is make all searches as close to O(n) as possible. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: List comp help

2013-07-14 Thread Terry Reedy
pairs == {('key_a', 'val_a'), ('key_a', 'val_b'), ('key_b', 'val_c'), ('key_c', None)} -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: a little more explicative error message?

2013-07-16 Thread Terry Reedy
isionError if it return a 0 and that 0 is later used as a divisor after f returns, as in 1/f(x). When you call wraps with a callable, there is no way for it to know that the callable in intended to the be the wrapper instead of the wrappee, unless it were clairvoyant ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug?

2013-07-16 Thread Terry Reedy
als() == locals(). But feel free to suggest a different fix for the issue than I did. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with pygame

2013-07-16 Thread Terry Reedy
s lef: 0, 1 to 0, Y-1 # excludes corners rit: X, 1 to X-1, Y-1 # excludes corners -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-18 Thread Terry Reedy
27;ll use that. I use Thunderbird. There is almost no difference between replying to emails and replying to newsgroup posts. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a list of lists to a single list

2013-07-23 Thread Terry Reedy
t cfLL == [ A0, B0, C0, C1, C2, B1, C0, C1, C2, B2, C0, C1, C2, A1, B0, C0, C1, C2, B1, C0, C1, C2, B2, C0, C1, C2, A2, B0, C0, C1, C2, B1, C0, C1, C2, B2, C0, C1, C2] passes -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a list of lists to a single list

2013-07-24 Thread Terry Reedy
On 7/23/2013 7:02 PM, Terry Reedy wrote: On 7/23/2013 5:52 PM, st...@divillo.com wrote: I think that itertools may be able to do what I want but I have not been able to figure out how. What you want is a flattened product with unchanged components of the successive products omitted in the

Re: Strange behaviour with os.linesep

2013-07-24 Thread Terry Reedy
with \r\n or \n on input and can produce either on output. Don't know about those, but SciTE I know has both an menu option for line ending (, , ), and one for "convert line endings" -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3: dict & dict.keys()

2013-07-24 Thread Terry Reedy
m in collection' is that iterating over 'collection' eventually produces 'item' or a value equal to 'item'. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-24 Thread Terry Reedy
ral chars. This is a nuisance for those who do use astral chars, such as emotes and CJK name chars, on an everyday basis. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-24 Thread Terry Reedy
On 7/24/2013 2:15 PM, Chris Angelico wrote: On Thu, Jul 25, 2013 at 3:52 AM, Terry Reedy wrote: For my purpose, the mock Text works the same in 2.7 and 3.3+. Thanks for that report! And yes, it's going to behave exactly the same way, because its underlying structure is an ordered li

Re: Python 3: dict & dict.keys()

2013-07-24 Thread Terry Reedy
ey must use 2.x libraries. 2.7 has all the old stuff, for back compatibility, and as much of the new stuff in 3.1 as seemed sensible, for forward compatibility. Thus it has lots of confusing duplication, and in this case, triplication -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner. 2d rotation gives unexpected results.

2013-07-24 Thread Terry Reedy
On 7/24/2013 5:17 PM, Joshua Landau wrote: import math as m GAH! Why on earth would you do such a thing? for the same reason people do 'import tkinter as tk': to minimize typing and maximize clarity. In this case, from math import sin, cos, radians also works well --

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Terry Reedy
might, for instance, allow multiple slices in a view, as tk Text widgets do.) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Terry Reedy
gt;> '0,1,1,1,2,3,4,5'.split(',') ['0', '1', '1', '1', '2', '3', '4', '5'] Would a shebang still be the right way to go? On Linux, definitely, whether you have user enter on the command line or in response to a prompt. On windows, it only helps with 3.3+. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Terry Reedy
Some additional comments. On 7/25/2013 7:00 PM, Terry Reedy wrote: On 7/25/2013 4:58 PM, CTSB01 wrote: 1) I decided to use Python 2.7, and I will be sure to specify this in all future threads. Given that you are not using any libraries, let alone one that does not run on Python 3, I

  1   2   3   4   5   6   7   8   9   10   >