Re: A request (was: how to repeat function definitions less

2009-03-17 Thread Marc 'BlackJack' Rintsch
-- yet have nothing worthy of 500 lines! Could this be the reason why I cannot see his messages on Google Groups? I don't see them either. My news server provider filters spam too. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: A Dangling Tk Entry

2009-03-11 Thread Marc 'BlackJack' Rintsch
] ) return frame_delay Then he did it consequently wrong. `frame_delay` is always `None` here so the ``return`` is useless. You asked what this code means and now you don't like the answer that it's somewhat useless code!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: A Dangling Tk Entry

2009-03-09 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: A Dangling Tk Entry

2009-03-09 Thread Marc 'BlackJack' Rintsch
On Mon, 09 Mar 2009 04:22:57 -0700, W. eWatson wrote: Marc 'BlackJack' Rintsch wrote: On Sun, 08 Mar 2009 22:20:09 -0700, W. eWatson wrote: You didn't answer my question why entry is necessary at all. The original author thought it was necessary to return entry. I'll give you a peek

Re: /a is not /a ?

2009-03-07 Thread Marc 'BlackJack' Rintsch
this example show? And where's the singleton here? BTW: In [367]: a = 2 ^ 100 In [368]: b = 2 ^ 100 In [369]: a == b Out[369]: True In [370]: a is b Out[370]: True Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Response codes and \r\n

2009-03-05 Thread Marc 'BlackJack' Rintsch
of with strip(), is that the best way? At which point do you get rid of it and why? BTW the last line of the code snippet needs parenthesis to actually *call* the `conn.close` method. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Marc 'BlackJack' Rintsch
`StringVar`. Why have two ways of doing this? Convenience. Setting a `Variable` that is used in a widget, automatically updates the display of the widget. And `Variable`\s have a method to add callbacks that get called when the content changes. Ciao, Marc 'BlackJack' Rintsch -- http

Re: A Simple Tkinter Control Program--Slight Problem

2009-03-04 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: What does self.grid() do?

2009-03-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Mar 2009 09:04:50 -0800, chuck wrote: On Mar 3, 10:40 pm, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Tue, 03 Mar 2009 18:06:56 -0800, chuck wrote: I am learning python right now.  In the lesson on tkinter I see this piece of code from Tkinter import * class MyFrame

Re: What does self.grid() do?

2009-03-03 Thread Marc 'BlackJack' Rintsch
. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: iterating through files

2009-02-20 Thread Marc 'BlackJack' Rintsch
: main() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: memory recycling/garbage collecting problem

2009-02-16 Thread Marc 'BlackJack' Rintsch
is not given back to the operating system. This doesn't mean that it is not freed by Python and can't be used again by Python. Create the dictionary again and see if the memory usage rises again or if it stays stable. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Marc 'BlackJack' Rintsch
software. You can tag versions with symbolic names like Dev4 or Release-1.0 and can ask the VCS for a copy of the sources with a given tag or even date. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterable Ctypes Struct

2009-02-11 Thread Marc 'BlackJack' Rintsch
? If not then `ctypes` might be the wrong tool. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Super() confusion

2009-02-10 Thread Marc 'BlackJack' Rintsch
. For the simple case, though, like that presented by the OP, I believe super() is perfect. But for the simple cases it is unnecessary because it was invented to deal with multiple inheritance problems. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Super() confusion

2009-02-10 Thread Marc 'BlackJack' Rintsch
(this is not polite). So I'm impolite. :-) I'm using multiple inheritance only for mixin classes and even that quite seldom. No `super()` in my code. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-01 Thread Marc 'BlackJack' Rintsch
without any getters or setters through the reflection API. See the article `Subverting Java Access Protection for Unit Testing`_ for examples. .. _Subverting Java Access Protection for Unit Testing: http://www.onjava.com/pub/a/onjava/2003/11/12/reflection.html Ciao, Marc 'BlackJack

Re: verilog like class w/ bitslicing int/long classtype

2009-01-31 Thread Marc 'BlackJack' Rintsch
On Fri, 30 Jan 2009 21:59:34 +0100, Stef Mientki wrote: Marc 'BlackJack' Rintsch wrote: On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex

Re: is python Object oriented??

2009-01-31 Thread Marc 'BlackJack' Rintsch
to access it, its name would be `_very_interesting_member`. I don't have to wait till compile time to see that, it is really obvious at the time I write the code to access it, or decide not to because it is not part of the API. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Marc 'BlackJack' Rintsch
): return '0x%X' % self.value __str__ = __repr__ This is unnecessary, the fallback of `__str__` is `__repr__` already. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Newby: how to transform text into lines of text

2009-01-26 Thread Marc 'BlackJack' Rintsch
On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote: content = a.readlines() (Just because we can now write for line in file doesn't mean that readlines() is *totally* redundant.) But ``content = list(a)`` is shorter. :-) Ciao, Marc 'BlackJack' Rintsch -- http

Re: Newby: how to transform text into lines of text

2009-01-26 Thread Marc 'BlackJack' Rintsch
On Mon, 26 Jan 2009 16:10:11 +0100, Andreas Waldenburger wrote: On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote: content = a.readlines() (Just because we can now write for line in file doesn't mean

Re: A different kind of interface

2009-01-25 Thread Marc 'BlackJack' Rintsch
; charset=utf-7 Why weird? Makes perfect sense: In [98]: print '+IBQ-'.decode('utf-7') — In [99]: unicodedata.name('+IBQ-'.decode('utf-7')) Out[99]: 'EM DASH' So there are newsreaders out there that can't or at least don't decode UTF-7. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Reading the first MB of a binary file

2009-01-25 Thread Marc 'BlackJack' Rintsch
'\x00\x00\x00\x00\x00\x00\x00' As MRAB says, maybe the first 1024 actually *are* all zero bytes. Wild guess: That's a file created by a bittorrent client which preallocates the files and that file above isn't downloaded completely yet!? Ciao, Marc 'BlackJack' Rintsch -- http

Re: A different kind of interface

2009-01-22 Thread Marc 'BlackJack' Rintsch
what an IBQ is. +IBQ- seems to be the way your newsreader displays the dashes that where in Ben's posting. I see em dash characters there: In [84]: unicodedata.name(u'—') Out[84]: 'EM DASH' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Style Guide Questions - Contd.

2009-01-19 Thread Marc 'BlackJack' Rintsch
'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Relax Syntax for Augmented Arithmetic?

2009-01-18 Thread Marc 'BlackJack' Rintsch
'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner: Data type conversion question

2009-01-15 Thread Marc 'BlackJack' Rintsch
to avoid such code duplication. if date == currentDate: inc += 1 elif date currentDate: inc = 1 else: assert False # Should never happen. return %s%02d % (date, inc) That's it. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Does Python really follow its philosophy of Readability counts?

2009-01-14 Thread Marc 'BlackJack' Rintsch
. So they respect the leading underscore convention. No use case for enforced access restriction. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-13 Thread Marc 'BlackJack' Rintsch
for trouble to me. That's why those regions are usually write protected and no execution allowed from the code in the user area of the virtual address space. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding Title mail

2009-01-12 Thread Marc 'BlackJack' Rintsch
find the solution. Look into the `email` package in the standard library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of Readability counts?

2009-01-12 Thread Marc 'BlackJack' Rintsch
. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings and coding conventions

2009-01-11 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: are there some special about '\x1a' symbol

2009-01-10 Thread Marc 'BlackJack' Rintsch
as end of text character in text files by Windows. So if you want all, unaltered data, open the file in binary mode ('rb' and 'wb'). Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
you simply write the values sequentially, why can't you just use a flat list and append here? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 19:33:53 +1000, James Mills wrote: On Fri, Jan 9, 2009 at 7:15 PM, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: Why parentheses around ``print``\s argument? In Python 3 ``print`` is a statement and not a function. Not true as of 2.6+ and 3.0+ print is now

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
are mapped to ones after the loop which gives a pretty boring PGM. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
') as data_file: blocks = iter(partial(data_file.read, blocksize), '') pixel_values = imap(ord, iter_max_values(blocks, pixels)) write_pgm(filename + '.pgm', width, height, pixel_values) if __name__ == '__main__': main() Ciao, Marc 'BlackJack' Rintsch -- http

Re: string split

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 12:39:22 -0800, Leland wrote: It seems work this way, but is there more elegant way to do this? Yes, the `csv` module in the standard library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Where's Psyco now?

2009-01-09 Thread Marc 'BlackJack' Rintsch
code. And for some very generic functions that are called with lots of different types, the memory consumption is high because of all the specialized code that will be compiled. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Jan 2009 15:34:17 +, MRAB wrote: Marc 'BlackJack' Rintsch wrote: def iter_max_values(blocks, block_count): for i, block in enumerate(blocks): histogram = defaultdict(int) for byte in block: histogram[byte] += 1 yield max

Re: python -3 not working as expected

2009-01-08 Thread Marc 'BlackJack' Rintsch
in Python 3 (print()). Where is the problem? There is no problem. ``print``\s are handled fine by the 2to3.py script. The option warns about stuff that is not easily automatically converted. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-07 Thread Marc 'BlackJack' Rintsch
that. Using reference counting for memory management is an implementation detail. It's possible to use other garbage collectors without the need of reference counting. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: del behavior 2

2009-01-07 Thread Marc 'BlackJack' Rintsch
not get a chance to take care of those, what is a good way to do so? Does a try/finally or a with statement address that? Thanks! If you clean up the mess in the ``finally`` branch: yes. Ctrl+C raises a `KeyboardInterrupt`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: An idea of how to identify Israeli owned software companies

2009-01-07 Thread Marc 'BlackJack' Rintsch
'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter - problem closing window

2009-01-06 Thread Marc 'BlackJack' Rintsch
=resultado) 30hello.pack() 31F.mainloop() …and here. There is only one `Tk` instance and mainloop allowed per `Tkinter` application. Otherwise really strange things can happen. Additional windows have to be created as `Toplevel` instances. Ciao, Marc 'BlackJack' Rintsch -- http

Re: why cannot assign to function call

2009-01-05 Thread Marc 'BlackJack' Rintsch
On Sun, 04 Jan 2009 20:03:11 -0600, Derek Martin wrote: On Sat, Jan 03, 2009 at 10:15:51AM +, Marc 'BlackJack' Rintsch wrote: On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: What's the difference between Python and Java or C# here!? Or are they also BIZARRE!? I am happily

Re: why cannot assign to function call

2009-01-05 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Take the first n items of an iterator

2009-01-04 Thread Marc 'BlackJack' Rintsch
On Sun, 04 Jan 2009 10:55:17 +, Steven D'Aprano wrote: I thought there was an iterator in itertools for taking the first n items of an iterator, then halting, but I can't find it. Did I imagine such a tool, or am I missing something? `itertools.islice()` Ciao, Marc 'BlackJack

Re: Why not Ruby?

2009-01-03 Thread Marc 'BlackJack' Rintsch
is something different than answering a question that should have been a new thread start. Oh, and: *plonk* for your childish annoying behaviour… Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-03 Thread Marc 'BlackJack' Rintsch
the named bins model from the majority of other languages people are likely to have been exposed to is simple and sensible. I think the bin model is more complex because you don't just have a name and an object but always that indirection of the bin. Ciao, Marc 'BlackJack' Rintsch

Re: Returning a string

2009-01-03 Thread Marc 'BlackJack' Rintsch
. As you can see, it prints 'Afghanistan' but it can not returns it. In change, the another strings are returned. Maybe you should show the *input* too… Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Videocapture in python

2009-01-01 Thread Marc 'BlackJack' Rintsch
On Thu, 01 Jan 2009 04:28:21 -0800, koranthala wrote: Please let me know if you need any more information. Where does `videocapture.py` coming from? It's not part of the standard library. And which operating system are we talking about? Ciao, Marc 'BlackJack' Rintsch -- http

Re: Memory leak problem (while using tkinter)

2008-12-31 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Marc 'BlackJack' Rintsch
not. With ``set(dict.keys())`` there is a point in time where the dictionary, the list, and the set co-exist in memory. With ``set(dict.iterkeys())`` only the set and the dictionary exist in memory. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Marc 'BlackJack' Rintsch
doesn't see the whole picture and demands changes that look easy at first sight, but are hard to implement right and efficient or just shifts the problem somewhere else where the next joe-python trips over it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Marc 'BlackJack' Rintsch
they add a more flexible and powerful way!? Python 3.0 is not a bug fix release. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow

2008-12-21 Thread Marc 'BlackJack' Rintsch
!? :-) cm_gui is slow! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Marc 'BlackJack' Rintsch
of ``type(a)``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Marc 'BlackJack' Rintsch
On Sun, 21 Dec 2008 15:30:34 +, Duncan Booth wrote: Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: a+b+c+d might execute a.__add__(b,c,d) allowing more efficient string concatenations or matrix operations, and a%b%c%d might execute as a.__mod__(b,c,d). But that needs special casing

Re: New Python 3.0 string formatting - really necessary?

2008-12-20 Thread Marc 'BlackJack' Rintsch
to remember. If people can't understand that, i fear for the future of Humans as a species! Yeah, doomsday is near. Curly brackets and a number instead of a percent sign followed by an 's' is a sure sign of the end… You're a funny little troll, Sir. Ciao, Marc 'BlackJack' Rintsch -- http

Re: encoding problem

2008-12-20 Thread Marc 'BlackJack' Rintsch
On Fri, 19 Dec 2008 16:50:39 -0700, Joe Strout wrote: Marc 'BlackJack' Rintsch wrote: And does REALbasic really use byte strings plus an encoding!? You betcha! Works like a dream. IMHO a strange design decision. I get that you don't grok it, but I think that's because you haven't

Re: How to parsing a sequence of integers

2008-12-19 Thread Marc 'BlackJack' Rintsch
()` and ``/``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2008-12-19 Thread Marc 'BlackJack' Rintsch
literal, and thus generates the error. The question is why the Python interpreter use the default encoding instead of utf-8, which I explicitly declared in the source. Because the declaration is only for decoding unicode literals in that very source file. Ciao, Marc 'BlackJack' Rintsch

Re: List comprehension in if clause of another list comprehension

2008-12-19 Thread Marc 'BlackJack' Rintsch
On Fri, 19 Dec 2008 04:26:16 -0800, bearophileHUGS wrote: Peter Otten: The problem is that list comprehensions do not introduce a new namespace. I think Python3 fixes this bug. Or removes that feature. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Marc 'BlackJack' Rintsch
n00b? Not important at all. Beside the point that '%s' is still possible -- someone who knows C but struggles with replacing '%s' by '{0}' has far greater problems. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2008-12-19 Thread Marc 'BlackJack' Rintsch
On Fri, 19 Dec 2008 08:20:07 -0700, Joe Strout wrote: Marc 'BlackJack' Rintsch wrote: The question is why the Python interpreter use the default encoding instead of utf-8, which I explicitly declared in the source. Because the declaration is only for decoding unicode literals

Re: encoding problem

2008-12-19 Thread Marc 'BlackJack' Rintsch
On Fri, 19 Dec 2008 15:20:08 -0700, Joe Strout wrote: Marc 'BlackJack' Rintsch wrote: And because strings in Python, unlike in (say) REALbasic, do not know their encoding -- they're just a string of bytes. If they were a string of bytes PLUS an encoding, then every string would know what

Re: How can I return a non-zero status result from a python script?

2008-12-15 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Dec 2008 13:12:08 -0800, silverburgh.me...@gmail.com wrote: How can I return a non-zero status result from the script? Just do a return 1? at the end? ``sys.exit(42)`` Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread Marc 'BlackJack' Rintsch
to methods. It's the XML structure that is not reflected by the indentation, the program flow is represented just fine here. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimizing methods away or not?

2008-12-14 Thread Marc 'BlackJack' Rintsch
()` at specific points even in optimized code if you want or need. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimizing methods away or not?

2008-12-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Dec 2008 09:19:45 +, Marc 'BlackJack' Rintsch wrote: class Parrot: def __init__(self, *args): print Initialising instance... assert self.verify() Here I meant ``assert self._verify()`` of course. def _verify(self): print Verifying

Re: the official way of printing unicode strings

2008-12-14 Thread Marc 'BlackJack' Rintsch
that first line: sys.stdout = codecs.getwriter('utf-8')(sys.stdout) Why is it even more cumbersome to execute that line *once* instead encoding at every ``print`` statement? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: var or inout parm?

2008-12-13 Thread Marc 'BlackJack' Rintsch
types and sometimes with tuples, and there rebinding is necessary. If I couldn't use it in this way: ``x = 0; x += z``, I'd call that a bad design decision. It would be a quite useless operator then. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Umlauts in idle

2008-12-13 Thread Marc 'BlackJack' Rintsch
for bytes that are non-printable or not within the ASCII range for strings. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: File names, character sets and Unicode

2008-12-12 Thread Marc 'BlackJack' Rintsch
version of the byte string file name, but keep the byte string for operations on the file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: (Very Newbie) Problems defining a variable

2008-12-12 Thread Marc 'BlackJack' Rintsch
to look at the text how many spaces will be displayed. Better use four real spaces to indent one level so it looks the same everywhere. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: var or inout parm?

2008-12-12 Thread Marc 'BlackJack' Rintsch
7 STORE_FAST 0 (a) 10 LOAD_CONST 0 (None) 13 RETURN_VALUE Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing None objects from a sequence

2008-12-12 Thread Marc 'BlackJack' Rintsch
correct code before having one-liner contests with your perl-loving friends :) If you call something an error, make sure it really is one. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: var or inout parm?

2008-12-12 Thread Marc 'BlackJack' Rintsch
on implementation details: t = (1, 2) t[0] = 1 # Maybe okay -- maybe not. t[1] += 0 # Same here. I'd find that quite odd. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcement: MindTree for Python beta -- feedback appreciated

2008-12-10 Thread Marc 'BlackJack' Rintsch
that Python3 has no future? :-) It is just not built in. So it is easier to change the future by replacing the module. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 3.0 worth breaking backward compatibility?

2008-12-09 Thread Marc 'BlackJack' Rintsch
of release. So this year's releases have version 8 and the latest is from october so it is 8.10. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get a beep, OS independent ?

2008-12-07 Thread Marc 'BlackJack' Rintsch
notifications. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread Marc 'BlackJack' Rintsch
, the class method definition might seem strange. And after the change it continues to because they will run into *both* variants in tutorials, code, and books, so it might be even more confusing. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pydoc enforcement.

2008-12-01 Thread Marc 'BlackJack' Rintsch
object has documentation like this just to make the compiler happy: def spam(foo, bar): :param foo: a foo object. :param bar: a bar object. Which basically tells the same as no documentation at all. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: unicode and hashlib

2008-11-29 Thread Marc 'BlackJack' Rintsch
algorithm. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Instance attributes vs method arguments

2008-11-25 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Instance attributes vs method arguments

2008-11-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Nov 2008 10:48:01 +, John O'Hagan wrote: On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote: On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b

Re: Using dictionary to hold regex patterns?

2008-11-23 Thread Marc 'BlackJack' Rintsch
though a list was index=value, where value=a single piece of data. Your thought was correct, each value is a single piece of data: *one* tuple. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: initialization in argument definitions

2008-11-22 Thread Marc 'BlackJack' Rintsch
many people guessed the right way. Or how many worked through the tutorial, stumbled across the warning about that behavior and got that question answered before they have even known there's something to guess. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Avoiding local variable declarations?

2008-11-17 Thread Marc 'BlackJack' Rintsch
like ``a = a + 1`` which must be obviously false unless 1 is defined as the neutral element for the definition of ``+`` here. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoiding local variable declarations?

2008-11-17 Thread Marc 'BlackJack' Rintsch
On Tue, 18 Nov 2008 00:18:51 +, Steven D'Aprano wrote: On Mon, 17 Nov 2008 12:32:35 +, Marc 'BlackJack' Rintsch wrote: Not such illogical crap like ``a = a + 1`` which must be obviously false unless 1 is defined as the neutral element for the definition of ``+`` here. I don't

Re: [UnicodeEncodeError] Don't know what else to try

2008-11-15 Thread Marc 'BlackJack' Rintsch
()` and an explicit encoding. I'd use 'utf-8' as default but give the user of the program a possibility to make another choice. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: [UnicodeEncodeError] Don't know what else to try

2008-11-14 Thread Marc 'BlackJack' Rintsch
the process at the other end expects, for example if output is redirected to a file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple breaks

2008-11-13 Thread Marc 'BlackJack' Rintsch
, is this possible to affect the two iterators? Or the only means is to use exception? You could put the code into its own, maybe local, function and use ``return``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.stdout, urllib and unicode... I don't understand.

2008-11-12 Thread Marc 'BlackJack' Rintsch
in the `string` module that are also implemented as method on `str` or `unicode` are deprecated. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question about Python lists

2008-11-11 Thread Marc 'BlackJack' Rintsch
something like this: b = a([1 5 8]); I can't seem to figure out a similar Python construct for selecting specific indices. Any suggestions? b = [a[i] for i in [1, 5, 8]] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: C Module question

2008-11-10 Thread Marc 'BlackJack' Rintsch
On Mon, 10 Nov 2008 05:36:58 -0800, [EMAIL PROTECTED] wrote: On Nov 10, 1:16 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Mon, 10 Nov 2008 03:11:06 -0800, [EMAIL PROTECTED] wrote: 1. How can I pass a file-like object into the C part? The PyArg_* functions can convert objects

Re: C Module question

2008-11-10 Thread Marc 'BlackJack' Rintsch
it in and out? Simply use the C module level to store the information. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: C Module question

2008-11-10 Thread Marc 'BlackJack' Rintsch
considering the `ctypes` module to call your C stuff. This way it is easier to build the extension and it is also independent from the Python version. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >