Re: import problems.

2012-01-11 Thread Antoon Pardon
On 01/11/2012 03:45 PM, Antoon Pardon wrote: On 01/11/2012 02:57 PM, Peter Otten wrote: Antoon Pardon wrote: I have an import problem I can't figure out. I am using python 2.6.6 on a debian box In one directory (pylib) I have a file misc.py and the file testutil.py. from misc i

How to subclass a family

2013-04-08 Thread Antoon Pardon
code in such circumstances? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Antoon Pardon
Op 15-04-13 12:11, Steven D'Aprano schreef: Python's data model has always been 100% object oriented. Prior to the "class/type" unification, it simply had *two distinct* implementations of objects: types, which were written in C, and classes, which were written in Python. After unification, th

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-16 Thread Antoon Pardon
Op 16-04-13 05:17, Terry Jan Reedy schreef: > On 4/15/2013 10:32 PM, Steven D'Aprano wrote: >> On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote: > >>> Some builtin classes cannot be subclassed. There is an issue to >>> document >>> which better. That does not mean that it is not a class. >

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-17 Thread Antoon Pardon
Op 16-04-13 18:49, Terry Jan Reedy schreef: > On 4/16/2013 5:07 AM, Antoon Pardon wrote: >> Op 16-04-13 05:17, Terry Jan Reedy schreef: >> >>> I will keep the above in mind if I write or review a patch. here are 4 >>> non-subclassable builtin classes. Two are al

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Antoon Pardon
Op 22-04-13 11:18, Steven D'Aprano schreef: > On Mon, 22 Apr 2013 03:08:24 -0500, Andrew Berg wrote: > >> Much of the stdlib doesn't rely on anything but the core interpreter. >> tkinter by itself is not the issue. As you said, the bindings are tiny. >> However, in order to be usable, it requires q

Re: slice notation as values?

2005-12-12 Thread Antoon Pardon
Op 2005-12-10, Devan L schreef <[EMAIL PROTECTED]>: > > Antoon Pardon wrote: >> On 2005-12-10, Duncan Booth <[EMAIL PROTECTED]> wrote: > [snip] >> >> I also think that other functions could benefit. For instance suppose >> >> you want to it

Re: slice notation as values?

2005-12-12 Thread Antoon Pardon
Op 2005-12-10, Brian Beck schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Will it ever be possible to write things like: >> >> a = 4:9 > > I made a silly recipe to do something like this a while ago, not that > I'd recommend using it. But I also

Re: slice notation as values?

2005-12-12 Thread Antoon Pardon
Op 2005-12-11, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 10 Dec 2005 12:07:12 -0800, "Devan L" <[EMAIL PROTECTED]> wrote: > >> >>Antoon Pardon wrote: >>> On 2005-12-10, Duncan Booth <[EMAIL PROTECTED]> wrote: >>[snip] >>

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-12 Thread Antoon Pardon
problems with it. Well problems is probably too strong, would prefer differently seems closer. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: slice notation as values?

2005-12-12 Thread Antoon Pardon
Op 2005-12-12, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 12 Dec 2005 08:34:37 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>Op 2005-12-10, Devan L schreef <[EMAIL PROTECTED]>: >>> >>> Antoon Pardon wrote: >>>> On 2005-12-10,

Re: Another newbie question

2005-12-12 Thread Antoon Pardon
Op 2005-12-11, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Sat, 10 Dec 2005 15:46:35 +, Antoon Pardon wrote: > >>> But I *want* other classes to poke around inside my implementation. >>> That's a virtue, not a vice. My API says: >>>

Re: Another newbie question

2005-12-12 Thread Antoon Pardon
Op 2005-12-12, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Mon, 12 Dec 2005 12:12:46 +, Antoon Pardon wrote: > >>> And maybe it isn't a Coordinate class at all, hmmm? >> >> Indeed it isn't. It is usually a Point class. >> >>&

Re: "0 in [True,False]" returns True

2005-12-13 Thread Antoon Pardon
True >>>> False == 0 > True >>>> int(False) > 0 > > but seriously, unless you're writing an introspection tool, testing for > bool is pretty silly. just use "if v" or "if not v", and leave the rest to > Python. That depends

Re: "0 in [True,False]" returns True

2005-12-13 Thread Antoon Pardon
y this is implemented is by registering an idle handler when the tube is not empty and removing it when the tube is empty. So I have a variable cb_src (for callback source) that can be a boolean or an integer. The possible values are False: Not registered by the user True: Registered by the user but no nternal idle callback registerd a number: gtk integer ID, from the registered idle callback handler. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: "0 in [True,False]" returns True

2005-12-13 Thread Antoon Pardon
Op 2005-12-13, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-12-13, Steve Holden schreef <[EMAIL PROTECTED]>: >> >>>Pierre Quentel wrote: >>> >>>>Hi all, >>>> >>>>In some program I w

Re: "0 in [True,False]" returns True

2005-12-13 Thread Antoon Pardon
odd that each time declaration are mentioned people here react very rejecting and say that one of the features they love about python is the freedom that a name is not limited to a variable of one type, while when someone makes use of that freedom labeling such code as code smell. But lets make an eff

Re: "0 in [True,False]" returns True

2005-12-14 Thread Antoon Pardon
Op 2005-12-13, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-12-13, Chris Mellon schreef <[EMAIL PROTECTED]>: > [...] >>>If you have a consistent API and you're checking for error values from >>>your GTK functions, the

Re: "0 in [True,False]" returns True

2005-12-14 Thread Antoon Pardon
Op 2005-12-14, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >>>It would be somewhat more self-documenting, but why not just use one >>>name to indicate the state and another, only meaningful in certain >>>states, to indicate the callb

Re: OO in Python? ^^

2005-12-14 Thread Antoon Pardon
effect those staments need to have is that each time a variable is rebound an assert statement would implicitly be executed, checking whether the variable is still an instance of the declared type. (Assuming for simplicity that all classes are subclasses of object so that all objects are instances of object.) > How could you make a module such as my_module.py, In the above scenario in just the same way as in python. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: "0 in [True,False]" returns True

2005-12-14 Thread Antoon Pardon
> Because usually (in my applications anyway) NaN is a perfectly > valid value and not an "exception" case that needs to be handled. I don't see the difference. In my application False and True (or Registered and UnRegistered if you prefer) are perfectly valid values too. They are not "exception" cases that need to be handled. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: "0 in [True,False]" returns True

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Grant Edwards schreef <[EMAIL PROTECTED]>: > On 2005-12-14, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>>>> Well, as you might argue, I'm not tryng to effect a change in >>>>> your behaviour, I'm simply trying to point out

Re: "0 in [True,False]" returns True

2005-12-15 Thread Antoon Pardon
ight type. > > Once you get beyond the variable either having a valid value or not, > it's really time to consider a different approach. How do you feel about testing for set membership? I can have a set with values to be treated differently than values not in the set. Do you consider that an acceptable approach? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Christopher Subich schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Suppose we would add type declarations in python. >> So we could do things like >> >> int: a >> object: b >> >> Some people seem to think that this wo

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
g with only a tiny fraction of the claimed benefits, but it would > give a hefty performance penalty. Yes it would give a performance penalty. That is irrelavant to the question asked. Nothing stops the language designers from using this type information, to produce more efficient code where possibl

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > > Antoon Pardon wrote: >> Op 2005-12-14, Christopher Subich schreef >> > Doesn't work; duck typing is emphatically not subclass-typing. >> >> I don't see how that is relevant. >> >&

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > > Antoon Pardon wrote: >> Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > >> So? I answered a question. That my answer is not usefull for >> a specific purpose is very well prosible but is AFA

Re: Adding methods to instances

2005-12-16 Thread Antoon Pardon
ass. That > works, but makes it a function, which doesn't automatically get sent > the 'self' reference. But this will make the function a method to all instances of the class. Is that what you want? From your first post I had the impression you only wanted the function to be the method of one particular instance. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Ben Finney schreef <[EMAIL PROTECTED]>: > [quoting private email with permission] > > Antoon Pardon wrote: >> I just downloaded your enum module for python [from the Cheeseshop] >> and played a bit with it. IMO some of the behaviour makes it less

Re: "0 in [True,False]" returns True

2005-12-16 Thread Antoon Pardon
Op 2005-12-15, Grant Edwards schreef <[EMAIL PROTECTED]>: > On 2005-12-15, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>> Well, in my case, a given name (or return value) is always >>> bound to a floating point object. I don't test the type of the >

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
==' is > that it doesn't help in cases such as:: > > >>> ShirtSize = Enum('small', 'medium', 'large') > >>> AppleSize = Enum('small', 'large') > > What should be the result of this comparison:: > > >>> ShirtSize.small == AppleSize.small > > Are they "the same value"? They're both "small" (and they both coerce > to the same string value, and in this case the same integer value). > > If not, is 'False' the right way to indicate that? I would agree 'False' is the right answer here. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
against it. I don't like the following returning True: ShirtSize.small in [ShirtSize.Medium, AppleSize.small] I also think it may cause problems with other comparisons. Supose the following: col = Enum('red', 'green', 'blue') paint = Enum('violet' , 'blue', 'red') Then we get the following situation: col.red == paint.red and col.blue == paint.blue but col.red < col.blue and paint.blue < paint.red -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: thread and alarm

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Sergey schreef <[EMAIL PROTECTED]>: > How to send alarm to a thread? > I can set alarm in main thread, but how then send exception to another thread > to wake it if it executes too long? The short answer is you can't and you should preferably look for an other solution. If for exam

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
> Antoon Pardon wrote: >> Ben Finney wrote: >> > Would it be better if every Enum instance had its own unique >> > subclass of EnumValue, that was used to instantiate values for >> > that enumeration? >> >> If you decide on keeping the current

Problem with exec

2005-12-16 Thread Antoon Pardon
for both the global and the local variables. I provided a dictionary to be used for the global variables and it contains a 'config' entry, so why doesn't this work? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with exec

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Peter Otten schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> I have the following little piece of code: >> >> class Cfg:pass >> #config = Cfg() >> >> def assign(): >> setattr(config, 'Start' , [13, 26, 29

Re: Problem with exec

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Larry Bates schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> I have the following little piece of code: >> >> class Cfg:pass >> #config = Cfg() >> >> def assign(): >> setattr(config, 'Start' , [13, 26, 29, 3

Re: Problem with exec

2005-12-19 Thread Antoon Pardon
Op 2005-12-16, Peter Otten schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> I'm using PLY. The assign function is a dumbded down version >> of a production function that will be called during the parsing >> of a config file. Each time a line of th

Re: canceling and joining threads

2005-12-19 Thread Antoon Pardon
thread? 3) Are you on windows of linux? Some introductiory text about using threads with gtk is on http://www.pardon-sleeuwaegen.be/antoon/python/page0.html However a lot is linux specific. There is also a mainling list for pygtk users. You can subscribe here: http://www.daa.com.au/mailman/listinfo/pygtk -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: canceling and joining threads

2005-12-20 Thread Antoon Pardon
; application itself) and then the second thread that i create with > threading.Thread, in which i make some things; in this thread i call > gtk.gdk to update a window with a progress bar... You will have to put your gtk.gdk calls between gtk.gdk.threads_enter and gtk.gdk.threads_leave calls t

Re: synchronized enumerate

2005-12-20 Thread Antoon Pardon
ad of having to use the cumbersome slice notation. Something like: enum(lst, start:start+count) Instead of enum(lst, slice(start, start+count)) Of course if you wouldn't mind brackets instead of parenthesis we could implement enum as a vitual slice, we then would have to write: enum[lst, start:start+count] Just my 2 cents. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

type 'slice' is not an acceptable base type

2005-12-20 Thread Antoon Pardon
order to be able to subclass base types. So why doesn't this work? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why my thread can't access the global data?

2005-12-21 Thread Antoon Pardon
names in a function you have to use the global statement. So your function would start: def read_send(s): global go_on s.setblocking(1) ... -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: type 'slice' is not an acceptable base type

2005-12-21 Thread Antoon Pardon
Op 2005-12-21, Michael Hoffman schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Traceback (most recent call last): >> File "", line 1, in ? >> File "vslice.py", line 48, in ? >> class iterslice(slice): >> TypeError: Err

Re: How to check if a string "is" an int?

2005-12-21 Thread Antoon Pardon
7;15' >>>>> if x.isdigit(): >> print int(x)*3 > > 15 is not a digit. 1 is a digit. 5 is a digit. Putting them together to > make 15 is not a digit. So? the isdigit method tests whether all characters are digits. >>> '15'.isdigit() True -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is 'None' not assignable but 'True'/'False' are?

2006-01-04 Thread Antoon Pardon
t;some string" And often enough it is followed with the advise not to shadow builtins. So if python goes the route of keywords, it seems that all builtins should be turned into keywords and not just a few of them. But that would make it impossible to do things like obj.str, just as it is

Re: itertools.izip brokeness

2006-01-05 Thread Antoon Pardon
this with all iterables, and you have to because you don't know which one is the smaller, all iterators will be infinite and izip will never stop. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.izip brokeness

2006-01-09 Thread Antoon Pardon
Op 2006-01-05, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 5 Jan 2006 15:48:26 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>On 2006-01-04, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>><[EMAIL PROTECTED]> wrote: >>>> But here is

Re: Is 'everything' a refrence or isn't it?

2006-01-09 Thread Antoon Pardon
mislead. Well then I would think that the language that misleads is not "reference" but assignment. Because it is not their idea of call by reference that leads to the misconception, but their idea of what an assignment does. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Spelling mistakes!

2006-01-09 Thread Antoon Pardon
e > available from the Zope 3 project and PyProtocols, both are > good. I don't think unit tests are that helpfull in this case. Unit tests help you in finding out there is a bug, they don't help that much in tracking down a bug. I for some reason a person is reading over the diff

testing units in a specific order?

2006-01-09 Thread Antoon Pardon
a particular order? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.izip brokeness

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 9 Jan 2006 08:19:21 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>Op 2006-01-05, Bengt Richter schreef <[EMAIL PROTECTED]>: >>> On 5 Jan 2006 15:48:26 GMT, Antoon Pardon <[EMAIL PROTECTED

Re: Spelling mistakes!

2006-01-10 Thread Antoon Pardon
Op 2006-01-09, Xavier Morel schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> I don't think unit tests are that helpful in this case. >> Unit tests help you in finding out there is a bug, they >> don't help that much in tracking down a bug. >> &g

Re: testing units in a specific order?

2006-01-10 Thread Antoon Pardon
Op 2006-01-09, Tim Peters schreef <[EMAIL PROTECTED]>: > [Antoon Pardon] >> I have used unit tests now for a number of project. One thing >> that I dislike is it that the order in which the tests are done >> bears no relationship to the order they appear in th

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
are certainly circumstances that I would prefer 1 == (1,2) to throw an exception instead of simply turning up False. I would say some more thinking is needed in this area. Now we can have weird circumstances where A == B and B == C but A != C. I think such cases can be troublesome too for containers and the "in" operator. IMO some more thinking about this is needed before deciding this would be a good idea or not. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >>> You could fix this by patching all the appropriate methods. But then >>> how do you describe their behavior, without making some people expect >>> that

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
ded. In the case where you consider it an error if you are working with objects of different classes you now have to expicitely test for unequal types and raise an exception explicitly which is also more verbose. IMO if they aren't of the same type then the answer to: a < b is just as obviously False as a == b Yet how things are proposed now, the first will throw an exception and the latter will return False. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Peter Decker schreef <[EMAIL PROTECTED]>: > On 10 Jan 2006 13:33:20 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> IMO if they aren't of the same type then the answer to: >> >> a < b >> >> is just as obviously False as &

Re: Spelling mistakes!

2006-01-11 Thread Antoon Pardon
Op 2006-01-10, Terry Hancock schreef <[EMAIL PROTECTED]>: > On 9 Jan 2006 11:21:10 GMT > Antoon Pardon <[EMAIL PROTECTED]> wrote: >> Op 2006-01-06, Terry Hancock schreef >> <[EMAIL PROTECTED]>: >> > On 6 Jan 2006 07:30:41 -0800 >> > "Kraft

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Antoon Pardon
Op 2006-01-10, Christopher Subich schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2006-01-10, Peter Decker schreef <[EMAIL PROTECTED]>: > >>>I don't see the two comparisons as equivalent at all. If two things >>>are different, it does not fo

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Antoon Pardon
Op 2006-01-10, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >>>> There is no way in python now to throw an exception when you >>>> think comparing your object to some very different object >>>> is just

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Antoon Pardon
Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2006-01-10, Mike Meyer schreef <[EMAIL PROTECTED]>: >>>> Now you can take the practical option and decide that programmatically >>>> it make

Re: Why keep identity-based equality comparison?

2006-01-12 Thread Antoon Pardon
Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: >>> Antoon Pardon <[EMAIL PROTECTED]> writes: >>>> Op 2006-01-10, Mike Meyer sc

Re: Spelling mistakes!

2006-01-12 Thread Antoon Pardon
Op 2006-01-11, Hans Nowak schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Op 2006-01-10, Terry Hancock schreef <[EMAIL PROTECTED]>: >> >>>In unit testing, you write the code, then write code to test >>>the code, which must correctly ide

Re: Why keep identity-based equality comparison?

2006-01-12 Thread Antoon Pardon
Op 2006-01-12, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> There is a use case for things like 1 < (1,3) making sense and denoting >> a total order. When you have a hetergenous list, having a total order >> makes it possible to sort the lis

Re: Why keep identity-based equality comparison?

2006-01-12 Thread Antoon Pardon
Op 2006-01-12, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> The bisect module doesn't have an alternate comparison function >> neither has the heapqueue module. > > They could be extended. Care to enter a feature request? Not really becaus

Re: Spelling mistakes!

2006-01-13 Thread Antoon Pardon
remely shallow bug to find and fix if > you use the tools at your disposal. I have no problem with the statement: "Spelling errors are easy to fix if you use the tools at your disposal." But that statement doesn't limit the tools to unit testing. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-13 Thread Antoon Pardon
Op 2006-01-12, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: [ BIG CUT ] I'm going to drop this part. I disagree with you and think I can show some of your argum

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Antoon Pardon
of ("is the object") 1, and the third is the > string "hello". But if you execute L.append(False) then L is still the same object but it's value is different. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-16 Thread Antoon Pardon
Op 2006-01-14, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >>> If you >>> want to argue that the builtin sets should do that, you can - but >>> that's unrelated to the question of how the comparison operato

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Antoon Pardon
alternative, it > seems to me, is to conclude that empty strings, dicts, lists and tuples > all are equally valueless, and I don't think that is a good idea. > > The downside of my definition of "value" is that it is fuzzy and depends > on context. Often we want

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Antoon Pardon
Op 2006-01-14, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Sat, 14 Jan 2006 14:14:01 +, Antoon Pardon wrote: > >> On 2006-01-14, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>> On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: >>> >

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Antoon Pardon
ear. >>> Care to say what it does mean, then? >> I'd say a==b doesn't necessarily mean a and b have the same value. > > Care to say what it does mean (as opposed to what it doesn't mean), then? I would say: "is equivallent with". -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Antoon Pardon
> | True >> Evidently the value of 3.0 is the same as the value of 3. > > And they do. They are two different representations of the same > value. More in another thread. I would say they are two different values that are equivallent in a lot of ways. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-17 Thread Antoon Pardon
sequence.range(::2): which would be equivallent to for i in sequence.range() & (::2): -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-18 Thread Antoon Pardon
Op 2006-01-17, Steven Bethard schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Why don't we give slices more functionality and use them. >> These are a number of ideas I had. (These are python3k ideas) >> >> 1) Make slices iterables. (No more need fo

Re: Arithmetic sequences in Python

2006-01-18 Thread Antoon Pardon
ntless limitation and that literal slices could be very usefull when made into literals and usable as parameters. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-18 Thread Antoon Pardon
Op 2006-01-18, Tom Anderson schreef <[EMAIL PROTECTED]>: > On Tue, 17 Jan 2006, Antoon Pardon wrote: > >> Op 2006-01-16, Alex Martelli schreef <[EMAIL PROTECTED]>: >>> Paul Rubin <http://[EMAIL PROTECTED]> wrote: >>> >>>> Steven D'Ap

Re: Arithmetic sequences in Python

2006-01-18 Thread Antoon Pardon
st.append(start) start += step else: lst.append(el) return lst rnglst[3,4,5] --> [3, 4, 5] rnglst[1, 2:8] --> [1, 2, 3, 4, 5, 6, 7] rnglst[3:9:2, 21:6:-3] --> [3, 5, 7, 21, 18, 15, 12, 9] -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-19 Thread Antoon Pardon
become: list((list((3,)),)) In my opinion the bracket notation wins the clarity contest handsdown in this case and IMO these cases occure frequently enough. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: list(...) and list comprehensions (WAS: Arithmetic sequences in Python)

2006-01-20 Thread Antoon Pardon
s if you pass only one argument, and that >> argument is iterable. This is also the reason why set() doesn't work this >> way. > > Ah, you're right - I thought about the >1 case, but not that one. Well we could have list(a) return [a], and have a list_from_iterable. Although I would prefer a different name. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Augument assignment versus regular assignment

2006-07-12 Thread Antoon Pardon
On 2006-07-11, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: > >>AP> As I read the language reference the x stands for a target expression. >>AP> Now what does it mean to evaluate a target expre

Re: threading troubles

2006-07-12 Thread Antoon Pardon
; os.system. However if I put > xc.start() > xc.run() > > then it starts and runs it in foreground with my pygtk ui non responsive. > > What am I missing! You may be missing nothing. If I recall correctly a similar problem was once reported on the pygtk-list. Some investigatio

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Antoon Pardon
like getTmp setTmp. So why is tmp bad in code like: obj.tmp = f() But is setTmp ok in code like: obj.setTmp(f()) -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: stdout/stderr for only one thread in a multithreaded python app

2006-07-14 Thread Antoon Pardon
pen* but I can't read data from stdout until the > program has finished. What do you mean by this? Do you mean that the data that is passed between the two processes is so little it is all buffered until the second process finishes, at which time the first process receives it all? It so and

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Antoon Pardon
ve a slice that didn't include the a but included the b like: a|:b Now I expect a lot of resitance here, so it this seems not feasable, just drop it. 6) Is this is all asked too much, make slice at least subclassable. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Antoon Pardon
On 2006-07-14, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> These are just some ideas. Whether they fit into python or not I will >> leave to the developers. > > I'm not a Python pro. but: > >> 1) Lit

Re: dict = no ordered keys = no slicing

2006-07-15 Thread Antoon Pardon
re sets(), that is why > when sets are supposed to be used a dictionary or list is used. keys() > is one of these example. Hopefully this will change in P3K so that the > key_set_ of a dictionary is a set() so people don't get confused. And what do you think should be the result of keys of my Tree class? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: EuroPython 2006 and Py3.0

2006-07-15 Thread Antoon Pardon
On 2006-07-14, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> I have a tree class, a tree acts like a dictionary, but when you >> iterate over it, it always iterates over the keys in order. This >> makes it usefull

Re: Augument assignment versus regular assignment

2006-07-17 Thread Antoon Pardon
On 2006-07-14, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: > >>AP> Well I'll start on an possitive note and accept this. Now I'd like you >>AP> to answer some questions. > >>

Re: Augument assignment versus regular assignment

2006-07-17 Thread Antoon Pardon
escribed by the language reference? Shouldn't the language reference be clear enough to be understandable without the help of byte code generated by the reference implementation? Otherwise the reference implemenation is being used as part of the language definition and then it can never be wrong. -- A

Re: Augument assignment versus regular assignment

2006-07-18 Thread Antoon Pardon
On 2006-07-17, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: > >>AP> On 2006-07-14, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > >>>> Just read what it says. `It is only evaluated o

Re: Augument assignment versus regular assignment

2006-07-18 Thread Antoon Pardon
On 2006-07-17, Paul Boddie <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> >> What the language reference should have said IMO is that in case x >> is an attribute reference, index or slicing, the primary expression >> will be evaluated only once, as will be

Re: Augument assignment versus regular assignment

2006-07-18 Thread Antoon Pardon
On 2006-07-17, Terry Reedy <[EMAIL PROTECTED]> wrote: > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On 2006-07-15, Terry Reedy <[EMAIL PROTECTED]> wrote: >>> The problem with understanding augmented assignm

Re: array alice of [:-0] ??

2006-07-18 Thread Antoon Pardon
ms inconsistent to me; > I get the idea that -0=0, so it is taken as x[:0] -> [] That is correct. Negative indexes are a handy shorthand, but they can give unexpected/strange results in a number of cases. > 2) how then should one do this basic left-recursive subsetting (easily). x=[

Re: Augument assignment versus regular assignment

2006-07-19 Thread Antoon Pardon
On 2006-07-18, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On 2006-07-17, Terry Reedy <[EMAIL PROTECTED]> wrote: >>> Or, whether docs (and reasonable interpret

Re: Coding style

2006-07-19 Thread Antoon Pardon
moment but there could be in the future 3) None (meaning the producer was done) Just testing for the truth value of the returned result in order to see whether the client should continue or not would often have made the client exit prematurely. IME such cases where testing for the truth value

Re: Coding style

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Georg Brandl <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >>> Other than in PHP, Python has clear rules when an object of a builtin type >>> is considered false (i.e. when it's empty). So why not take advantage of >>> this? >

Re: Coding style

2006-07-20 Thread Antoon Pardon
es where I would consider an empty sequence as True, because a sequence in itself would mean, continue and the members would be the current available elements to be processed. Nothing is IMO not specific enough and doesn't make the disctinction between nothing (temporarily) now and nothing more (for ever). That is why I think the distinction between True and False is more usefull than the distinction between nothing and something. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 19 Jul 2006 12:27:39 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> >> I once had a producer consumer code. When the client asked whether new >&g

<    9   10   11   12   13   14   15   16   17   18   >