[ANN] imphook - Simple and clear import hooks for Python - import anything as if it were a Python module

2021-03-28 Thread Paul Sokolovsky
"run" a package, what actually gets run is ``__main__`` submodule in that package. That's exactly the "startup" file we discussed above. It installs the import hooks, and imports a submodule with actual application's functionality. Credits and licensing

[ANN] python-compiler upgraded to Python3.7, maintenance goes to Facebook

2021-02-19 Thread Paul Sokolovsky
Hello, python-compiler is a project to port Python2's stdlib "compiler" package (https://docs.python.org/2.7/library/compiler.html) to Python3. Initial porting work and support of CPython3.5 constructs/bytecode was done me. Around the Christmas time last year, there was a patch from some Facebook

[ANN] Pycopy/pycopy-lib 3.5.2, a minimalist Python dialect

2021-02-09 Thread Paul Sokolovsky
Hello, Pycopy is a minimalist, lightweight, resource-efficient implementation of Python(-like) language. Pycopy to CPython is a similar thing as Scheme to Common Lisp. Executable sizes of 300-400KB, instant startup, no need to carry around large monolithic library consisting largely of legacy

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Thanks. I would like to put this ticket in the context of other grammar-related tickets/elaboration for the assignment operator: https://bugs.python.org/issue42316 - allow foo[a:=1] instead of foo[(a:=1)] https://bugs.python.org/issue42374 - allow (c := i

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- nosy: +lys.nikolaou ___ Python tracker <https://bugs.python.org/issue43143> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-06 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently (CPython 3.10.0a4) having a tuple on left-hand side of assignment expression/operator (aka walrus operator) is not allowed: >>> ((a, b) := (1, 2)) File "", line 1 ((a, b) := (1, 2)) ^ SyntaxError: cannot use ass

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > the idea was proposed purely to "close a gap" That pinpoints it well. I was just writing a tutorial on implementing custom import hooks, with the idea to show people how easy it to do it in Python. As first step, I explained that it's bad i

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > There is a considerable tension on exposed parts of the compiler pipeline for > introspection and other capabilities and our ability to do optimizations. > Given how painful it has been in the past to deal with this, my view is to > av

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > but the thing I don't quite get is the use case. And if that went unanswered: the usecase, how I'd formulate it, is to not expose CPython historical implementation detail of "tokenize" being disconnected from the rest of the langua

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > What prevents you from using ast.parse(tokenize.untokenize(token_stream))? That's exactly the implementation in the patch now submitted against this issue. But that's the patch for CPython, the motive of the proposal here is to establish a standard

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- keywords: +patch pull_requests: +22773 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23922 ___ Python tracker <https://bugs.python.org/issu

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently, it's possible: * To get from stream-of-characters program representation to AST representation (AST.parse()). * To get from AST to code object (compile()). * To get from a code object to first-class function to the execute the program. Python

[ANN] pyastinterp - Tree-walking interpreter for Python (+ "advent of code" idea)

2020-12-23 Thread Paul Sokolovsky
hon/3.6/Lib/test/pystone.py python3 -m astinterp pystone.my 1 You can pass any other script on the command line and see how it goes. Credits and licensing - Pyastinterp is (c) [Paul Sokolovsky](https://github.com/pfal

[ANN] Pycopy/pycopy-lib 3.4.0, a minimalist Python dialect

2020-12-10 Thread Paul Sokolovsky
Hello, Pycopy is a minimalist, lightweight, resource-efficient implementation of Python(-like) language. Pycopy to CPython is a similar thing as Scheme to Common Lisp. Executable sizes of 300-400KB, instant startup, no need to carry around large monolithic library consisting largely of legacy

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-07 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Raymond Hettinger: Thanks for acking it would be a useful change! ZackerySpytz: Thanks for making a patch! -- ___ Python tracker <https://bugs.python.org/issue42

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-03 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Current docs for random.getrandbits() ( https://docs.python.org/3/library/random.html#random.getrandbits ) read (3.9.1rc1 at the top of the page): Returns a Python integer with k random bits. This method is supplied with the MersenneTwister generator

[ANN] Pycopy/pycopy-lib 3.1.0, a minimalist Python dialect

2020-04-28 Thread Paul Sokolovsky
Hello, Pycopy is a minimalist, lightweight, resource-efficient implementation of Python(-like) language. Pycopy to CPython is the same thing as Scheme to Common Lisp. Executable sizes of 300-400KB, instant startup, no need to carry around large monolithic library consisting largely of legacy

[ANN] Pycopy/pycopy-lib 3.0.5, minimalist Python(-like) implementation

2020-03-24 Thread Paul Sokolovsky
Hello, https://github.com/pfalcon/pycopy Pycopy is a minimalist, lightweight, resource-efficient implementation of Python(-like) language. Pycopy to CPython is the same thing as Scheme to Common Lisp. Executable sizes of 300-400KB, instant startup, no need to carry around large monolithic

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-17 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > We may be possible to replace bytecode from `STORE_GLOBAL _cnt; LOAD_GLOBAL > _cnt` into `DUP_TOP; STORE_GLOBAL _cnt`. Sounds good, and that's why I personally care about the "STORE" case, and the patch I submit touches only it, which w

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-17 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Absolutely should be able to optimize namespace access. The fact that namespace is a dict is an implementation detail, it's still inefficient even with all those version counters and inline caches. Ironically, to let people prototype better, more efficient

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > exec() function is currently quite clear A recent case: https://bugs.python.org/issue38316, co_stacksize was quite clear what it is. Turned out, a bug in the documentation (likely, just someone forgot to update it to the actual code). That's just

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > Namespace performances are really critical for overall Python performances. Yeah, that's why I'd like for myself and other people to make it easy to explore the behavior of namespace lookups, to see how to optimize them. > You're free to fork

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > Paul: you're are in front of 3 core developers who are rejecting your feature > request. But no, it's not my feature request. There were 2 tickets by at least 2 people. I just saw my case to be similar to cases of those people, so instead of cr

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > you ask to modify Python so you can pass dict subclasses as namespaces and > expect CPython to respect the mapping protocol But no, per your own account, you made noticeable, though not complete, code changes in that direction. The only thing I'm

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Ok, so the patch for my usecase (STORE_GLOBAL) is vividly trivial, so to go thru the full circle, I posted it: https://github.com/python/cpython/pull/18033 . -- ___ Python tracker <https://bugs.python.

[issue36220] LOAD_NAME and LOAD_GLOBAL, STORE_GLOBAL handle dict subclasses for globals() differently

2020-01-16 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- pull_requests: +17429 pull_request: https://github.com/python/cpython/pull/18033 ___ Python tracker <https://bugs.python.org/issue36

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: s/only our own usecase/only your own usecase/ (missing "y" typo) -- ___ Python tracker <https://bugs.python.o

[issue32615] Inconsistent behavior if globals is a dict subclass

2020-01-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > Later, I closed my pysandbox beause it was "broken by design": https://lwn.net/Articles/574215/ Thanks for the link, insightful. Still unclear, by design of what it's broken ;-). > Paul Sokolovsky wrote in bpo-36220 than his idea is a

[issue32615] Inconsistent behavior if globals is a dict subclass

2019-12-30 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > I agree with Terry, the moment you pass a dict subclass to exec you are out > of contract. If any, we may need to sanitize the input to exec, although I > don't think is worth paying the performance price for that. exec() params are alread

[issue32615] Inconsistent behavior if globals is a dict subclass

2019-12-30 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > The doc for exec says globals "must be a dictionary (and not a subclass of > dictionary)" Docs are full of mistakes and outdated information. Fixing STORE_GLOBAL case from https://bugs.python.org/issue36220#msg359046 would be triv

[issue32615] Inconsistent behavior if globals is a dict subclass

2019-12-30 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Some smart maintainer closed https://bugs.python.org/issue36220 as a duplicate of this one. That ticket might have more details of the underlying issues. -- nosy: +pfalcon ___ Python tracker <ht

[issue36220] LOAD_NAME and LOAD_GLOBAL, STORE_GLOBAL handle dict subclasses for globals() differently

2019-12-30 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > I wanted to write a sandbox for Python. Sandbox indeed, it is. class NS(dict): def __setitem__(self, k, v): if not isinstance(v, type(lambda: 0)): raise RuntimeError("Global variables considered harmful") globals

[issue36220] LOAD_NAME and LOAD_GLOBAL, STORE_GLOBAL handle dict subclasses for globals() differently

2019-12-30 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- nosy: +pfalcon title: LOAD_NAME and LOAD_GLOBAL handle dict subclasses for globals() differently -> LOAD_NAME and LOAD_GLOBAL, STORE_GLOBAL handle dict subclasses for globals() differently ___ Python tracker <

[ANN] Retrospective of Python compilation efforts

2019-12-24 Thread Paul Sokolovsky
Hello, Over the years, the Python community produced many compiler projects for the language, second to probably only C and LISP. Majority are of course of research and proof of concept quality, but there're a number of quite advanced projects. For some time, I was trying to compile a

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-09-29 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : CPython's Data Model -> Internal types -> Code objects, direct link as of version 3.7 is: https://docs.python.org/3.7/reference/datamodel.html?highlight=co_stacksize#index-55 , states following: * "co_nlocals is the number of local var

[ANN] Pycopy 2.11.0.9

2019-09-02 Thread Paul Sokolovsky
Hello, https://github.com/pfalcon/pycopy Pycopy is a minimalist, light-weight, resource-efficient implementation of Python(-like) language. Pycopy to CPython is the same things as Scheme to Common Lisp. Pycopy strives to define a core language features suitable to easily develop efficient

[issue12345] Add math.tau

2016-08-12 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: What about rounding pi to 3 (and tau to 6)? https://en.wikipedia.org/wiki/Indiana_Pi_Bill (and I'm sure we can find a cute video about how cool to have pi as 3 to add it to the docs). -- nosy: +pfalcon ___ Python

[ANN] MicroPython 1.8.2

2016-07-12 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python3 implementation for microcontrollers, embedded, mobile, and IoT systems (which also runs just as fine on desktops, servers, and clouds). v1.8.2 brings initial proof-of-concept multi-threading support in the form of the _thread module, which

[issue26899] struct.pack_into(), struct.unpack_from() don't document support for negative offsets

2016-05-01 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: See https://docs.python.org/3/library/struct.html#struct.pack_into https://docs.python.org/3/library/struct.html#struct.unpack_from Actual source contains code like: if (offset < 0) offset += vbuf.len; to allow specify offsets from the

[ANN] MicroPython 1.7

2016-04-13 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops, servers, and clouds). v1.7 adds the MicroPython cross-compiler that can generate .mpy files (pre-compiled bytecode) which can be

[issue1103213] Adding a recvexactly() to socket.socket: receive exactly n bytes

2016-04-08 Thread Paul Sokolovsky
Changes by Paul Sokolovsky <pfal...@users.sourceforge.net>: -- nosy: +pfalcon ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.o

[ANN] MicroPython 1.6

2016-02-12 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops, servers, and clouds). https://github.com/micropython/micropython https://github.com/micropython/micropython/releases/tag/v1.6 There're

[ANN] MicroPython 1.6

2016-02-12 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops, servers, and clouds). https://github.com/micropython/micropython https://github.com/micropython/micropython/releases/tag/v1.6 There're

[ANN] MicroPython 1.5

2015-11-08 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops of course). https://github.com/micropython/micropython Recent 1.5 release is an important milestone for the project, major changes

[ANN] MicroPython 1.5

2015-11-08 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops of course). https://github.com/micropython/micropython Recent 1.5 release is an important milestone for the project, major changes

Re: [ANN] MicroPython 1.5

2015-11-08 Thread Paul Sokolovsky
Hello, On Sun, 08 Nov 2015 10:28:24 -0800 Paul Rubin <no.email@nospam.invalid> wrote: > Paul Sokolovsky <pmis...@gmail.com> writes: > > Recent 1.5 release is an important milestone for the project, major > > changes including: > > Thanks for posting this. We do

Re: [ANN] MicroPython 1.5

2015-11-08 Thread Paul Sokolovsky
Hello, On Sun, 8 Nov 2015 12:08:20 -0700 paul.hermeneu...@gmail.com wrote: > What is the possibility that MicroPython could be another build from > the base python.org sources? Python already gets built for a variety > of architectures. Could a MicroPython be another one? In that way, it > would

ANN: ScratchABit - Interactive disassembler

2015-08-24 Thread Paul Sokolovsky
Hello, ScratchABit is pure-Python, interactive disassembler (direct-manipulation, textmode UI), suitable for reverse engineering work of malware analysis, security research, developing open-source drivers, etc. ScratchABit is architecture-independent and supports particular CPU using plugins.

ANN: MicroPython 1.4.5

2015-08-21 Thread Paul Sokolovsky
Hello, MicroPython is an implementation of a subset of Python 3.5 which is optimised for systems with minimal resources, including microcontrollers and embedded/IoT systems. https://github.com/micropython/micropython Changes in this release include: py core: - use wrapper to check self

[ANN] uasyncio - lean asyncio-like library

2015-06-29 Thread Paul Sokolovsky
Hello, It was mentioned several times on the list already, and I would like to finally make a formal announcement of it, also to mark mostly complete status. What: uasyncio is asyncio-like library for MicroPython (https://github.com/micropython/micropython) to accommodate writing asyncio-style

[issue24449] Please add async write method to asyncio.StreamWriter

2015-06-15 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Thanks for the response. and an API with more choices is not necessarily better. I certainly agree, and that's why I try to implement MicroPython's uasyncio solely in terms of coroutines, without Futures and Transports. But I of course can't argue

[issue24449] Please add async write method to asyncio.StreamWriter

2015-06-14 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: This issue was brought is somewhat sporadic manner on python-tulip mailing list, hence this ticket. The discussion on the ML: https://groups.google.com/d/msg/python-tulip/JA0-FC_pliA/knMvVGxp2WsJ (all other messages below threaded from this) https

[issue24449] Please add async write method to asyncio.StreamWriter

2015-06-14 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: No, I haven't brought this many times before. Discussion on the mailing list last week was first time I brought up *this* issue. But it's indeed not the first time I provide feedback regarding various aspects of asyncio, so I wonder if this issue was closed

[issue23702] docs.python.org/3/howto/descriptor.html still refers to unbound methods

2015-03-18 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: Under https://docs.python.org/3/howto/descriptor.html#functions-and-methods , there're several references to unbound methods (including in expected output from the interpreter). As known, unbound methods are gone in Python3, so seeing those are confusing

MicroPython 1.3.7 released

2014-12-08 Thread Paul Sokolovsky
Hello, MicroPython is a Python3 language implementation which scales down to run on microcontrollers with tens of Ks of RAM and few hundreds of Ks of code size. Besides microcontrollers, it's also useful for small embedded Linux systems, where storage space is limited, for embedding as a

MicroPython 1.3.7 released

2014-12-08 Thread Paul Sokolovsky
Hello, MicroPython is a Python3 language implementation which scales down to run on microcontrollers with tens of Ks of RAM and few hundreds of Ks of code size. Besides microcontrollers, it's also useful for small embedded Linux systems, where storage space is limited, for embedding as a

Re: PEP8 and 4 spaces

2014-07-03 Thread Paul Sokolovsky
Hello, On Fri, 4 Jul 2014 03:38:27 +1000 Chris Angelico ros...@gmail.com wrote: On Fri, Jul 4, 2014 at 3:31 AM, Tobiah tshep...@rcsreg.com wrote: Coworker takes PEP8 as gospel and uses 4 spaces to indent. I prefer tabs. Boss want's us to unify. 1) PEP 8 is meant to be guidelines,

Re: install software via Python script

2014-07-02 Thread Paul Sokolovsky
Hello, On Wed, 2 Jul 2014 18:01:45 -0400 Moshe Avraham mosheavraham2...@gmail.com wrote: HI Guys, I need to install variety of software (Oracle, SqlServer, upgrade JAVA version, WAS, WMB, Tomcat, etc.) on both WINDOWS and UNIX/LINUX. These are usual daily operation of large IT

Re: What's the right way to abandon an open source package?

2014-07-01 Thread Paul Sokolovsky
Hello, On Tue, 1 Jul 2014 12:30:44 -0500 Skip Montanaro s...@python.org wrote: This is only Python-related because the package in question (lockfile at PyPI) is written in Python and hosted (at least in part) on PyPI. I have not had any interest in maintaining this package for a few years. I

Re: What's the right way to abandon an open source package?

2014-07-01 Thread Paul Sokolovsky
Hello, On 01 Jul 2014 18:40:23 GMT Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 01 Jul 2014 20:59:48 +0300, Paul Sokolovsky wrote: Put it on github http://nedbatchelder.com/blog/201405/github_monoculture.html Everyone who (re)posts stuff like that should have

Re: What can Nuitka do?

2014-06-27 Thread Paul Sokolovsky
Hello, On Fri, 27 Jun 2014 16:25:02 -0700 (PDT) CM cmpyt...@gmail.com wrote: (Trying again, simpler and cleaner post) Can I use Nuitka to transform a wxPython GUI application in Python that uses several 3rd party modules into a small and faster compiled-to-C executable? Yes, you can.

Re: Asymmetry in globals __getitem__/__setitem__

2014-06-13 Thread Paul Sokolovsky
Hello, On Fri, 13 Jun 2014 12:53:54 +0200 Peter Otten __pete...@web.de wrote: [] exec(fun.__code__, {}, Namespace()) Neither __getitem__ nor __setitem__ seem to be called on the local variables. Accessing fun.__code__ is clever, but unfortunately the compiler produces different

Re: None in string = TypeError?

2014-06-09 Thread Paul Sokolovsky
Hello, On Mon, 9 Jun 2014 08:34:42 -0700 (PDT) Roy Smith r...@panix.com wrote: We noticed recently that: None in 'foo' raises (at least in Python 2.7) TypeError: 'in string' requires string as left operand, not NoneType This is surprising. The description of the 'in' operatator

Re: Uniform Function Call Syntax (UFCS)

2014-06-08 Thread Paul Sokolovsky
Hello, On Sun, 8 Jun 2014 01:15:43 -0700 (PDT) jongiddy jongi...@gmail.com wrote: Thanks for the extensive feedback. Here's my thoughts on how to address these issues. On Saturday, 7 June 2014 20:20:48 UTC+1, Ian wrote: It's a nice feature in a statically typed language, but I'm not

Re: Uniform Function Call Syntax (UFCS)

2014-06-08 Thread Paul Sokolovsky
Hello, On Sun, 8 Jun 2014 01:26:04 -0700 (PDT) jongiddy jongi...@gmail.com wrote: On Sunday, 8 June 2014 02:27:42 UTC+1, Gregory Ewing wrote: Also it doesn't sit well with Python's one obvious way to do it guideline, because it means there are *two* equally obvious ways to call a

Re: Uniform Function Call Syntax (UFCS)

2014-06-08 Thread Paul Sokolovsky
Hello, On Sun, 08 Jun 2014 18:56:47 +0300 Marko Rauhamaa ma...@pacujo.net wrote: Paul Sokolovsky pmis...@gmail.com: Python already has that - like, len(x) calls x.__len__() if it's defined In fact, what's the point of having the duality? len(x) == x.__len__() x y == x

Re: Benefits of asyncio

2014-06-03 Thread Paul Sokolovsky
Hello, On Mon, 02 Jun 2014 21:51:35 -0400 Terry Reedy tjre...@udel.edu wrote: To all the great responders. If anyone thinks the async intro is inadequate and has a paragraph to contribute, open a tracker issue. Not sure about intro (where's that?), but docs

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-03 Thread Paul Sokolovsky
Hello, On Tue, 3 Jun 2014 23:11:46 +1000 Chris Angelico ros...@gmail.com wrote: On Tue, Jun 3, 2014 at 10:27 PM, Damien George damien.p.geo...@gmail.com wrote: - Supports almost full Python 3 syntax, including yield (compiles 99.99% of the Python 3 standard library). - It supports a

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-03 Thread Paul Sokolovsky
Hello, On Wed, 4 Jun 2014 03:08:57 +1000 Chris Angelico ros...@gmail.com wrote: [] With that encouragement, I just cloned your repo and built it on amd64 Debian Wheezy. Works just fine! Except... I've just found one fairly major problem with your support of Python 3.x syntax. Your str type

[issue21511] Thinko in Lib/quopri.py

2014-05-16 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: This is minor issue indeed, uncovered when trying to run quopri.py with MicroPython http://micropython.org . I now worked around this on MicroPython side, but otherwise I set to report any issues I've seen with MicroPython porting, in the hope

[issue21511] Thinko in Lib/quopri.py

2014-05-15 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: Lib/quopri.py for version 3.3..3.5-tip contains following code: ESCAPE = b'=' ... line = input.readline() if not line: break i, n = 0, len(line) if n 0 and line[n-1:n] == b'\n': ... elif i+1 n and line[i+1

[issue21464] fnmatch module uses regular expression with undefined result to perform matching

2014-05-10 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: I see, so it's my misreading of the re module docs. I kinda thought that x in (?x) means any single-character flag of set (?aiLmsux). I was wrong, it is the specific literal flag. Also, rereading it again, the doc says the letters set the corresponding

[issue21464] fnmatch module uses undefined regular expression to perform matching

2014-05-09 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: fnmatch.translate() ends with: return res + '\Z(?ms)' However, https://docs.python.org/3.4/library/re.html#regular-expression-syntax states: Note that the (?x) flag changes how the expression is parsed. It should be used first in the expression string

[issue21464] fnmatch module uses regular expression with undefined result to perform matching

2014-05-09 Thread Paul Sokolovsky
Changes by Paul Sokolovsky pfal...@users.sourceforge.net: -- title: fnmatch module uses undefined regular expression to perform matching - fnmatch module uses regular expression with undefined result to perform matching ___ Python tracker rep

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-04-27 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: It caused me a big surprise that asyncio.Task object automatically schedules itself in the main loop for execution upon creation (i.e. in constructor). Nowhere in the main reference part of section 18.5.2.4. Task (https://docs.python.org/3.5/library

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-04-27 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Based on discussion https://groups.google.com/forum/#!topic/python-tulip/zfMQIUcIR-0 . That discussion actually questions the grounds of such Task behavior, and points it as a violation of Explicit is better than implicit principle, and as inconsistent

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-13 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: array.array('i', [0]) * 3 @Serhiy Storchaka: The keyword is efficiently. Let's analyze: this creates useless array.array('i', [0]) object destined only for garbage collection. Then, it forces using loop of loops to fill in a new object. Whereas

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-13 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: @Terry J. Reedy: Thanks for the pointer. My inital response is sadness, another bloating of namespace. But I'm adjusting. But that PEP shows the issue with all that activity: CPython stdlib got so big and bloated, that it lives its own life and people

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-13 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Martin: People might expect that array.array('i', 3) creates an array with the single value 3. I don't know which people would expect that. Personally I recognize the need to create an empty array of of given size, and have read the docs for builtin

[issue17145] memoryview(array.array)

2014-04-08 Thread Paul Sokolovsky
Changes by Paul Sokolovsky pfal...@users.sourceforge.net: -- nosy: +pfalcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-08 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: With bytearray, you can do: bytearray(3) bytearray(b'\x00\x00\x00') However, with arrays: array.array('i', 3) Traceback (most recent call last): File stdin, line 1, in module TypeError: 'int' object is not iterable Given that int passed as seconf

[issue9066] Standard type codes for array.array, same as struct

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: It's not clear to me that importing specifier prefixes from the struct module is the best way to go about this, though. What are other alternatives then? Using struct's syntax has obvious benefit of being consistent and not confusing people any further

[issue9066] Standard type codes for array.array, same as struct

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: See also http://bugs.python.org/issue17345 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9066 ___ ___ Python

[issue17345] Portable and extended type specifiers for array module

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: See also http://bugs.python.org/issue9066 -- nosy: +pfalcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17345

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: The problem with pystone is that such tool is used to compare performances between different versions of Python. That's why I just propose to switch it to time.time(), which surely is available on each and every Python version and implementation

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-02 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Yes, and my note about scientificity above. Also compare with your own account of time.perf_counter() above (Usually time.perf_counter() is the expected function.) Also, I didn't want to start discussion on how to do benchmarking right, just to point out

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-01 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: http://docs.python.org/3.3/library/time.html#time.clock says that it's deprecated, but pystone.py in Python-3.4.0b3 tarball still uses it. Please kindly consider switching it to plain time.time() and not to some other novelties. My usecase is: I'm

[issue20475] pystone.py in 3.4 still uses time.clock(), even though it's marked as deprecated since 3.3

2014-02-01 Thread Paul Sokolovsky
Changes by Paul Sokolovsky pfal...@users.sourceforge.net: -- components: +Benchmarks versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20475

[issue1346238] A constant folding optimization pass for the AST

2013-12-31 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: 8 years after the original patch, there's still no trivial constant folding in bytecode generated (because peephole of course is not a real optimizer to consistently catch all cases): $ cat const.py FOO = 1 BAR = FOO + 2 + 4 $ python --version Python 2.7.3

[issue10203] sqlite3.Row doesn't support sequence protocol

2010-10-26 Thread Paul Sokolovsky
New submission from Paul Sokolovsky pfal...@users.sourceforge.net: sqlite.Row class doesn't implement sequence protocol, which is rather unfortunate, because it is described and expected to work like a tuple, with extra mapping-like functionality. Specific issue I hit: Adding rows to PyGTK

[issue10203] sqlite3.Row doesn't support sequence protocol

2010-10-26 Thread Paul Sokolovsky
Changes by Paul Sokolovsky pfal...@users.sourceforge.net: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10203