Re: code review

2012-06-30 Thread Serhiy Storchaka
On 29.06.12 17:44, Littlefield, Tyler wrote: On 6/29/2012 2:14 AM, Serhiy Storchaka wrote: The project page is at: http://code.google.com/p/pymud Any information is greatly appreciated. Do you mean No, I mean http://code.google.com/p/pymud Then you probably should choose another name. -- h

Re: code review

2012-06-30 Thread Alister
On Sat, 30 Jun 2012 02:28:52 +, Steven D'Aprano wrote: > On Fri, 29 Jun 2012 19:41:11 +, Alister wrote: > >> also this section in main strikes me as a bit odd and convoluted >> >> w = world() >> serv = server(client) >> w.server = serv serv.world = w >> >> I think you are cr

Re: code review

2012-06-30 Thread Alister
On Fri, 29 Jun 2012 14:49:11 -0600, Littlefield, Tyler wrote: > I am no expert but from what have picked up so far from x import is > frowned upon in most cases also this section in main strikes me as a bit > odd and convoluted w = world() serv = server(client) w.server = serv > serv.world = w I t

Re: code review

2012-06-30 Thread Alister
On Sat, 30 Jun 2012 09:31:53 +, Alister wrote: > On Fri, 29 Jun 2012 14:49:11 -0600, Littlefield, Tyler wrote: > >> I am no expert but from what have picked up so far from x import is >> frowned upon in most cases also this section in main strikes me as a >> bit odd and convoluted w = world()

Re: code review

2012-06-30 Thread Alister
On Fri, 29 Jun 2012 09:03:22 -0600, Littlefield, Tyler wrote: > On 6/29/2012 1:31 AM, Steven D'Aprano wrote: >> On Thu, 28 Jun 2012 20:58:15 -0700, alex23 wrote: >> >>> On Jun 29, 12:57 pm, "Littlefield, Tyler" wrote: I was curious if someone wouldn't mind poking at some code. The proje

Re: code review

2012-06-30 Thread Peter Otten
Alister wrote: > I think I may be on firmer grounds with the next few: > > isValidPassword can be simplified to > > def isValidPassword(password: > count=len(password) > return count>= mud.minpass and count<= mud.maxpass > > ( I used count to save finding the length of password

tiffany 0.6.1 released

2012-06-30 Thread Christian Tismer
Tiffany - Read/Write Multipage-Tiff with PIL without PIL Tiffany stands for any tiff. The tiny module solves a large set of problems, has no dependencies and just works wherever Python works. Tiffany was developed in the course of the *DiDo

Re: PyDev IPython Confusion

2012-06-30 Thread Fabio Zadrozny
On Wed, May 23, 2012 at 5:06 PM, Wanderer wrote: > I have two versions of Python and Ipython; Python 2.6.6 with Ipython > 0.11 and Python 2.7.3 with Ipython 0.12. When I run the Eclipse PyDev > console for the Python 2.7.3 it says it is using Ipython 0.11 as the > interpreter. Ipython 0.11 should

Re: tiffany 0.6.1 released

2012-06-30 Thread Anthon van der Neut
Christian, I should have several larger Tiff files, but I would have to search a bi. I used tilded tiffs ack in the early 90-s as a solution to mapping large images onto raytraced surfaces on machines with only 20Mb of memory. I will have to search though and I am now travelling. If I fail to c

Re: tiffany 0.6.1 released

2012-06-30 Thread Paul Rubin
Christian Tismer writes: > Tiffany stands for any tiff. The tiny module solves a large set of > problems, has no dependencies and just works wherever Python works. > Tiffany was developed in the course of the *DiDoCa* project and will > always appear on PyPi. This sounds pretty neat. I didn't co

[ANN] IPython 0.13 is officially out!

2012-06-30 Thread Fernando Perez
Hi all, on behalf of the IPython development team, and just in time for the imminent Debian freeze and SciPy 2012, I'm thrilled to announce, after an intense 6 months of work, the official release of IPython 0.13. This version contains several major new features, as well as a large amount of bug

Re: code review

2012-06-30 Thread Thomas 'PointedEars' Lahn
Peter Otten wrote: > If you spell it > > def is_valid_password(password): > return mud.minpass <= len(password) <= mud.maxpass > > it is even easier to see that you are performing an interval check. This is probably a tautology around here, but *what* *a* *great* *programming* *language*.

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: > Peter Otten wrote: > >> If you spell it >> >> def is_valid_password(password): >> return mud.minpass <= len(password) <= mud.maxpass >> >> it is even easier to see that you are performing an interval check. > > This is probably a taut

Re: code review

2012-06-30 Thread Alister
On Sat, 30 Jun 2012 12:29:31 +0200, Peter Otten wrote: > Alister wrote: > >> I think I may be on firmer grounds with the next few: >> >> isValidPassword can be simplified to >> >> def isValidPassword(password: >> count=len(password) >> return count>= mud.minpass and count<= mud.

Re: code review

2012-06-30 Thread Alister
On Sat, 30 Jun 2012 21:38:58 +0200, Thomas Jollans wrote: > On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: >> Peter Otten wrote: >> >>> If you spell it >>> >>> def is_valid_password(password): >>> return mud.minpass <= len(password) <= mud.maxpass >>> >>> it is even easier to see th

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 10:30 PM, Alister wrote: > On Sat, 30 Jun 2012 21:38:58 +0200, Thomas Jollans wrote: > >> On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: >>> Peter Otten wrote: >>> If you spell it def is_valid_password(password): return mud.minpass <= len(password) <

Re: code review

2012-06-30 Thread Alain Ketterlin
Thomas Jollans writes: > def is_valid_password(password): > return mud.minpass <= len(password) <= mud.maxpass > Which of the two comparisons is done first anyway? > "In the face of ambiguity, refuse the temptation to guess." There is no ambiguity. See the language reference: "Form

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 11:07 PM, Alain Ketterlin wrote: > Thomas Jollans writes: > >> def is_valid_password(password): >> return mud.minpass <= len(password) <= mud.maxpass > >> Which of the two comparisons is done first anyway? >> "In the face of ambiguity, refuse the temptation to guess." >

Re: tiffany 0.6.1 released

2012-06-30 Thread Christian Heimes
Am 30.06.2012 18:25, schrieb Paul Rubin: > Christian Tismer writes: >> Tiffany stands for any tiff. The tiny module solves a large set of >> problems, has no dependencies and just works wherever Python works. >> Tiffany was developed in the course of the *DiDoCa* project and will >> always appear

Re: code review

2012-06-30 Thread Terry Reedy
On 6/30/2012 5:35 PM, Thomas Jollans wrote: On 06/30/2012 11:07 PM, Alain Ketterlin wrote: Thomas Jollans writes: def is_valid_password(password): return mud.minpass <= len(password) <= mud.maxpass Which of the two comparisons is done first anyway? "In the face of ambiguity, refuse th

Re: code review

2012-06-30 Thread Martin P. Hellwig
On Saturday, 30 June 2012 21:30:45 UTC+1, Alister wrote: > On Sat, 30 Jun 2012 21:38:58 +0200, Thomas Jollans wrote: > > > On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: > >> Peter Otten wrote: > >> > >>> If you spell it > >>> > >>> def is_valid_password(password): > >>> return mud

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 11:47 PM, Terry Reedy wrote: > On 6/30/2012 5:35 PM, Thomas Jollans wrote: >> On 06/30/2012 11:07 PM, Alain Ketterlin wrote: >>> Thomas Jollans writes: >>> def is_valid_password(password): return mud.minpass <= len(password) <= mud.maxpass >>> Which of the

Re: code review

2012-06-30 Thread Alain Ketterlin
Thomas Jollans writes: > On 06/30/2012 11:47 PM, Terry Reedy wrote: > def is_valid_password(password): > return mud.minpass <= len(password) <= mud.maxpass > Which of the two comparisons is done first anyway? > "In the face of ambiguity, refuse the temptation to

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 8:05 AM, Thomas Jollans wrote: > Yes. My sole point, really, is that "normally", one would expect these > two expressions to be equivalent: > > a < b < c > (a < b) < c > > This is clearly not true. Python has quite a few things like that, actually. The most noticeable for C

Re: code review

2012-06-30 Thread Thomas Jollans
On 07/01/2012 01:25 AM, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 8:05 AM, Thomas Jollans wrote: >> Yes. My sole point, really, is that "normally", one would expect these >> two expressions to be equivalent: >> >> a < b < c >> (a < b) < c >> >> This is clearly not true. > > Python has quite

Re: code review

2012-06-30 Thread Ben Finney
Thomas Jollans writes: > My sole point, really, is that "normally", one would expect these two > expressions to be equivalent: > > a < b < c > (a < b) < c What norm gives you that expectation? That's not how those operators work in mathematical notation. I know of no programming language that wo

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney wrote: > Thomas Jollans writes: > >> My sole point, really, is that "normally", one would expect these two >> expressions to be equivalent: >> >> a < b < c >> (a < b) < c > > What norm gives you that expectation? That's not how those operators > work in

Re: code review

2012-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote: > Yes. My sole point, really, is that "normally", one would expect these > two expressions to be equivalent: > > a < b < c > (a < b) < c Good grief. Why would you expect that? You can't just arbitrarily stick parentheses around parts of

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 12:06 PM, Steven D'Aprano wrote: > You can't just arbitrarily stick parentheses around parts of expressions > and expect the result to remain unchanged. Order of evaluation matters: > > 2**3**4 != (2**3)**4 But that's because ** binds right to left. It _is_ valid to say: 2

Re: code review

2012-06-30 Thread rusi
On Jul 1, 3:05 am, Thomas Jollans wrote: > Yes. My sole point, really, is that "normally", one would expect these > two expressions to be equivalent: > > a < b < c > (a < b) < c > > This is clearly not true. That's the inconsistency here I dont see the inconsistency with the specific example

Re: code review

2012-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2012 10:37:05 +1000, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney > wrote: >> Thomas Jollans writes: >> >>> My sole point, really, is that "normally", one would expect these two >>> expressions to be equivalent: >>> >>> a < b < c >>> (a < b) < c >> >> What n

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 1:23 PM, Steven D'Aprano wrote: > All the worse for those languages, since they violate the semantics of > mathematical notation. Not so. It simply means that booleans are nothing special. In REXX, there are no data types at all, and "1" and "0" are your booleans. In C, boo

Re: code review

2012-06-30 Thread rusi
On Jul 1, 8:23 am, Steven D'Aprano wrote: > On Sun, 01 Jul 2012 10:37:05 +1000, Chris Angelico wrote: > > On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney > > wrote: > >> Thomas Jollans writes: > > >>> My sole point, really, is that "normally", one would expect these two > >>> expressions to be equiv

Re: code review

2012-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2012 12:20:52 +1000, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 12:06 PM, Steven D'Aprano > wrote: >> You can't just arbitrarily stick parentheses around parts of >> expressions and expect the result to remain unchanged. Order of >> evaluation matters: >> >> 2**3**4 != (2**3)**

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 2:17 PM, Steven D'Aprano wrote: > Nonsense. Of course parens change the evaluation of the expression. > That's what parens are for! The whole point of my example was that it wouldn't. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 2:07 PM, rusi wrote: > Kernighan and Ritchie admit they made a design mistake with their > operator precedences: > > http://en.wikipedia.org/wiki/C_%28programming_language%29#Criticism > The examples given there have nothing to do with the chaining of comparisons and how it

how to use tkinter in python3.2?

2012-06-30 Thread contro opinion
tiger@ocean:~$ python3.2 Python 3.2.3 (default, Jul 1 2012, 11:07:14) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/tkinter/__init__.py", lin

Re: Re: code review

2012-06-30 Thread Evan Driscoll
On 6/30/2012 19:37, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney > wrote: >> I know of no programming language that >> would give a newcomer to Python that expectation. So where is the norm >> you're referring to? > > C, SQL, REXX, and many other languages. Some others: L

Re: code review

2012-06-30 Thread Evan Driscoll
On 6/30/2012 23:45, Evan Driscoll wrote: > You may also > want to put Java in there as well, as < is effectively not commutative > in that language. (I didn't try C#.) I guess you could actually put Lua and Ruby into the roughly same category as Java too. But things get a little nastier in ==, as

Re: how to use tkinter in python3.2?

2012-06-30 Thread Terry Reedy
On 7/1/2012 12:25 AM, contro opinion wrote: I am on Windows, but... tiger@ocean:~$ python3.2 Python 3.2.3 (default, Jul 1 2012, 11:07:14) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter Traceback (most recent call last): File

Re: code review

2012-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2012 14:23:36 +1000, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 2:17 PM, Steven D'Aprano > wrote: >> Nonsense. Of course parens change the evaluation of the expression. >> That's what parens are for! > > The whole point of my example was that it wouldn't. Yes, you can find sp

Re: code review

2012-06-30 Thread Chris Angelico
On Sun, Jul 1, 2012 at 4:27 PM, Steven D'Aprano wrote: > Yes, you can find specially crafted examples where adding parentheses in > certain places, but not others, doesn't change the overall evaluation of > the expression. My point was that adding parentheses around the tightest-binding operator

Re: code review

2012-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2012 13:48:04 +1000, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 1:23 PM, Steven D'Aprano > wrote: >> All the worse for those languages, since they violate the semantics of >> mathematical notation. > > Not so. It simply means that booleans are nothing special. In REXX, > there