Re: Py3K: file inheritance

2011-10-21 Thread Yosifov Pavel
On 21 окт, 13:50, Ian Kelly wrote: > On Thu, Oct 20, 2011 at 10:17 PM, Yosifov Pavel wrote: > > Little silly example: > > > class MyFile(file): > > šdef __init__(self, *a, **ka): > > š šsuper(MyFile, self).__init__(*a, **ka) > > š šself.commented =

Re: Py3K: file inheritance

2011-10-20 Thread Yosifov Pavel
On 21 окт, 00:42, Ian Kelly wrote: > On Thu, Oct 20, 2011 at 11:28 AM, Yosifov Pavel wrote: > > In the Python 2.x was simple to create own file object: > > > class MyFile(file): > > špass > > > for example to reimplement write() or something else. How to do it in

Py3K: file inheritance

2011-10-20 Thread Yosifov Pavel
In the Python 2.x was simple to create own file object: class MyFile(file): pass for example to reimplement write() or something else. How to do it in Python 3.x? -- http://mail.python.org/mailman/listinfo/python-list

typedef (type alias) and ctypes

2009-02-07 Thread Yosifov Pavel
I try to create type aliases, like typedef in C (a specially aliases to ctypes objects). This case: >>> some_type = c_ulong >>> oth_type = c_ulong works in all cases but not with type qualification: >>> t1 = c_ulong # reference to c_ulong, nothing else :( >>> t2 = c_ulong >>> x = t1() >>> y = t2

Re: iterator clone

2008-07-16 Thread Yosifov Pavel
On 16 июл, 11:32, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 15 Jul 2008 19:54:30 -0700, Yosifov Pavel wrote: > > Kay, can you show example of such generator? ReIter, for example, work > > with usual generators. > > > But for "bi

Re: iterator clone

2008-07-15 Thread Yosifov Pavel
Kay, can you show example of such generator? ReIter, for example, work with usual generators. But for "big" iterator, I think is no any good solutions. IMHO we can discern 2 types of iterators: re-startable (based on internal Python objects) and not re-startable (with an external state, side- effe

Re: iterator clone

2008-07-14 Thread Yosifov Pavel
On 14 июл, 23:36, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > (snip) > > > defcloneiter( it ): > > """return (clonable,clone)""" > > return tee

Re: iterator clone

2008-07-14 Thread Yosifov Pavel
> `tee()` doesn't copy the iterator or its internal state but just caches > it's results, so you can iterate over them again. That makes only sense > if you expect to use the two iterators in a way they don't get much out of > sync. If your usage pattern is "consume iterator 1 fully, and then > r

Re: iterator clone

2008-07-13 Thread Yosifov Pavel
> Well, I think Python's iterators, especially the generators, are beautiful. > More importantly, I think there is no general way to make iterators > copyable, regardless of the programming language. The problem is that most > of the useful ones depend on external state. > > Peter Hmm, but tee() d

Re: iterator clone

2008-07-13 Thread Yosifov Pavel
On 13 июл, 14:12, Peter Otten <[EMAIL PROTECTED]> wrote: > Yosifov Pavel wrote: > > Whats is the way to clone "independent" iterator? I can't use tee(), > > because I don't know how many "independent" iterators I need. copy and > > deepcop

iterator clone

2008-07-12 Thread Yosifov Pavel
Whats is the way to clone "independent" iterator? I can't use tee(), because I don't know how many "independent" iterators I need. copy and deepcopy doesn't work... --pavel -- http://mail.python.org/mailman/listinfo/python-list

Re: Unhandled exceptions checking

2008-05-25 Thread Yosifov Pavel
On 24 май, 12:58, bukzor <[EMAIL PROTECTED]> wrote: > On May 23, 6:31 pm, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > > > Does somebody know existent tool for checking unhandled exceptions? > > Like in Java when method throws exception but in code using this > >

Unhandled exceptions checking

2008-05-23 Thread Yosifov Pavel
Does somebody know existent tool for checking unhandled exceptions? Like in Java when method throws exception but in code using this method, try...catch is missed. May be something like PyChecker? -- /Pavel -- http://mail.python.org/mailman/listinfo/python-list