"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
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
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
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
Change by Paul Sokolovsky :
--
nosy: +lys.nikolaou
___
Python tracker
<https://bugs.python.org/issue43143>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
Change by Paul Sokolovsky :
--
pull_requests: +17429
pull_request: https://github.com/python/cpython/pull/18033
___
Python tracker
<https://bugs.python.org/issue36
Paul Sokolovsky added the comment:
s/only our own usecase/only your own usecase/ (missing "y" typo)
--
___
Python tracker
<https://bugs.python.o
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
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
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
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
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
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
<
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
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
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
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
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
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
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
Changes by Paul Sokolovsky <pfal...@users.sourceforge.net>:
--
nosy: +pfalcon
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.o
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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,
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Paul Sokolovsky pfal...@users.sourceforge.net:
--
nosy: +pfalcon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17145
___
___
Python
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
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
Paul Sokolovsky added the comment:
See also http://bugs.python.org/issue17345
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9066
___
___
Python
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
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
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
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
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
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
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
Changes by Paul Sokolovsky pfal...@users.sourceforge.net:
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
91 matches
Mail list logo