[Python-Dev] Alternative Python VM

2007-02-16 Thread Sokolov Yura
h quality (speed and size). """ http://students.ceid.upatras.gr/~sxanth/pyvm/ Sokolov Yura (funny_falcon) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

[Python-Dev] str.dedent

2005-11-22 Thread Sokolov Yura
>>/ msg = textwrap.dedent('''\ >/>/ IDLE's subprocess can't connect to %s:%d. This may be due \ >/>/ to your personal firewall configuration. It is safe to \ >/>/ allow this internal connection because no data is visible on \ >/>/ external ports.''' % address)

[Python-Dev] (no subject)

2005-11-11 Thread Sokolov Yura
> > >Mixing Decimal and float is nearly ALWAYS a user error. Doing it correctly >requires significant expertise in the peculiarities of floating point >representations. > So that I think user should declare floats explicitly (###.###f) - he will fall into float space only if he wish it. >So Pyt

[Python-Dev] Unifying decimal numbers.

2005-11-09 Thread Sokolov Yura
Excuse my English I think, we could just segregate tokens for decimal and real float and make them interoperable. Motivation: Most of us works with business databases - all "floats" are really decimals, algebraic operations should work without float inconsistency and those operations rare so

Re: [Python-Dev] Pythonic concurrency - offtopic

2005-10-14 Thread Sokolov Yura
Josiah Carlson wrote: >Sokolov Yura <[EMAIL PROTECTED]> wrote: > > >>Offtopic: >> >>Microsoft Windows [Version 5.2.3790] >>(C) Copyright 1985-2003 Microsoft Corp. >> >>G:\Working\1>c:\Python24\python >>Python 2.4.1 (#65, Mar 30 20

[Python-Dev] Autoloading? (Making Queue.Queue easier to use)

2005-10-13 Thread Sokolov Yura
May be allow modules to define __getattr__ ? def __getattr__(thing): try: return __some_standart_way__(thing) except AttributeError: if thing=="Queue": import sys from Queue import Queue setattr(sys.modules[__name__],"Queue"

[Python-Dev] Pythonic concurrency - offtopic

2005-10-13 Thread Sokolov Yura
Offtopic: Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. G:\Working\1>c:\Python24\python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from os import fork Tr

[Python-Dev] PEP 3000 and exec

2005-10-13 Thread Sokolov Yura
Agree. >>>i=1 >>>def a(): i=2 def b(): print i return b >>>a()() 2 >>>def a(): i=2 def b(): exec "print i" return b >>>a()() 1 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

[Python-Dev] Adding a conditional expression in Py3.0

2005-09-27 Thread Sokolov Yura
New keyword is so expensive? And why special case for 'then' is better than special case for 'take'? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

[Python-Dev] Adding a conditional expression in Py3.0

2005-09-25 Thread Sokolov Yura
Sorry for looking in every hole. Just a suggestion. A= condition and first or second problem is in case when first in (None,0,[],""). May be invent new operator 'take'. take - returns right operator when left evals to True and stops computing condidtional expression. Then we could write: A = co

[Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Sokolov Yura
Ok. While windows already prefers threads, while linux-2.6 improves thread support and speed, while process startup expensive on time and memory, while we ought to dublicate our data and/or use obscure shared memory, while it is much simpler to make threaded program with care just about locks th

[Python-Dev] Mixins.

2005-09-19 Thread Sokolov Yura
Excuse my english. Is there any pythonic way to make real mixin into a class? Problem: Django model (and may be SQLObject). I have a common peaces of model declaration. Sometimes they are in table definition together, sometimes table have just one of them. I cannot use inheritance, cause Dja

Re: [Python-Dev] Variant of removing GIL.

2005-09-15 Thread Sokolov Yura
Corrections: Now, every thread keeps one n queue of objects to incref and second queue to decref. Both can be implemented as array, cause they will be freed at once. Initially, every thread acquires GIL for "read". Py_INCREF places a ref into a incref queue of a thread, Py_DECREF places a ref in

[Python-Dev] Variant of removing GIL.

2005-09-15 Thread Sokolov Yura
Excuse my English. I think I know how to remove GIL Obviously I am an idiot. First about Py_INCREF and Py_DECREF. We should not remove GIL at all. We should change it. It must be "one writer-many reader" in a following semantic: Lock has a "read-counter" and a "write-counter". Initially bo

Re: [Python-Dev] Skiping searching throw dictionaries of mro() members.

2005-09-15 Thread Sokolov Yura
Phillip J. Eby wrote: > At 09:12 PM 9/14/2005 +0400, Sokolov Yura wrote: > >> We could cash looks by this way: >> Store with a class its version. Every time after creation when we change >> a class >> (add,remove or chage class member, including __base__, __bases__

[Python-Dev] Skiping searching throw dictionaries of mro() members.

2005-09-14 Thread Sokolov Yura
Excuse my english. I have a complex Idea. It can be not worth, but just look at. It touches the classes and inheritance. Base point: We change classes not too often. But every look at a member leads to search throw a __dict__ of all bases in ierarhy till member found. We could cache this search