Yes I can, but I am taking about to use it without `asyncio.run`
Whenever Python in Top-Level faces with await it will wrap calling all top
level statement in async function (for example)
___
Python-ideas mailing list -- python-ideas@python.org
To
It is not the same, it will work in interactive mode But I want to run
application without interactive mode
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
I mean to be able to do something like this:
```python
import asyncio
await asyncio.sleep(1);
```
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Hi all,
Deno is JavaScript runtime that has very nice feature like Top Level Await, I
think it would be also nice to have such feature in Python, it will make using
async/await more convenient
What do you think ? Share your ideas lets discuss ...
___
For me it easier to do with C++, I know C, but with C++ it is more maintainable
and easier to add new feature and also easier to refactor ...
I am not sure if CPython maintainers team will appropriate that I add C++ in
code base ...
But I can try, I will try to find time to create small proof
I have found very nice attempt of JIT for CPython
https://github.com/tonybaloney/Pyjion
It is working under .NET Runtime, but if it is possible in this project I
believe it is possible in CPython as well
Also to integrate JIT compilcation now it not so hard because we can use llvm
ability for
Good design should follow open-close principle from SOLID ...
You provide template (standard way to do something) for community and if
package can work through this interface that is required all goes good ...
In such way community would have the standard way to do something instead of
lots of
Yes, it is not bad, it is open-close principle from SOLID for good design
system ...
You provide template (standard way to do something) for community and if
package can work through this interface that is required all goes good ...
In such way community would have the standard way to do
It is not to get something in stdlib, it is simple option in cli ))
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
It is also about convenience
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
No, it is not good design choose, because then all type-checker will have
different optional and it will be a mess ...
It should be done in one place like python
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to
I do not want to make type-checker a part of CPython, I just what options that
will allow to run python with first some type-checker ...
For example, you would be able to set default python module for type-checking
and if there is not module set for type checking, verify if `mypy` installed
and
Steven D'Aprano wrote:
> On Sun, Dec 06, 2020 at 10:22:53AM -, redrad...@gmail.com wrote:
> > It would be nice to have "Typed Python" mode that
> > will look like this:
> > #!/usr/bin/env bash
> >
> > set -e
> > python -m mypy $1
> > python $1
> >
> > What does that mean? Why is it a bash
Also if such mode would exsist, it would be nice to have special keywords for
such mode like `protocol`
Instead of writing:
```python
class MathType(Protocol):
def reduce(self, *args) -> int:
...
```
it woulb be nicer to have special syntax:
```python-mypy
protocol MathType:
def
It would be nice to have "Typed Python" mode that will look like this:
```bash
#!/usr/bin/env bash
set -e
python -m mypy $1
python $1
```
https://gist.github.com/redradist/dd7253a55081a4dc13fdf3f1549f43b5
It could be achieved by adding special flag like `
I like this literal syntax !!
Can't wait to use it !!
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived
Actually, I would like to write a proposal ...
It would be nice if someone support me with it because I will do it at first
time ... )
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
No it is not possible to have something like this:
```python
def function(cls):
# Where is cls is Neuron class object
pass
class Neuron:
activation = function(Neuron)
```
___
Python-ideas mailing list -- python-ideas@python.org
To
Also instead of making all class as dataclass, it would be possible to make
only some properties as instance properties:
```python
class Client:
bank = Bank()
@instance
name = Name()
print(f'Client.bank is {Client.bank}')
client = Client()
print(f'client.name is {client.name}')
```
Actually in example:
```python
class MyClass:
@my_property
name = arg
class MyClass:
def name(self):
...
def see_name(self):
...
```
I have done mistake ... of course it will not be like this ...
What I wanted to show that @my_property could add more complex
I think a property decorator can be useful, because you consider the simplest
case with:
```python
class MyClass:
@my_property
name = arg
```
but consider it can generate the following code:
```python
class MyClass:
def name(self):
...
def see_name(self):
...
```
But I can do the same thing with class methods ... but anyway it was introduced
method decorators to simplify development and add extra power ...
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to
It could work if we extend syntax like this:
```python
class Neuron:
activation # By default creates activation with None value
activation = linear_activation(activation)
```
and then we could apply as may decorators as needed:
```python
class Neuron:
activation # By default creates
Also there is maybe some addition parameter like self:
```python
class Neuron:
@instance_property
activation
def __init__(self):
# automatically created
pass
...
def instance_property(name, property, self, *args):
# Create property on instance
```
Decorator will do the same thing as general decorator
For example it could be implemented like this:
```python
class linear_activation:
def __init(self, name, property):
...
def linear_activation(name, property):
...
```
___
Disagree, because for example what if I want custom property with two or three
decorators ?
Like this:
```python
class Neuron:
@softmax_activation(weights=["w0", "w1"])
@linear_activation
activation
def __init__(self):
self.w0 = [...]
self.w1 = [...]
...
```
Hi all,
Seems like this topic was previously raised, but what if we add possibility to
decorate non function properties in class:
```python
class Neuron:
@linear_activation
activation
```
___
Python-ideas mailing list --
I know, I know that PyPy is fast as V8 but PyPy implement the whole library
inside and it is not easy to embed it somewhere
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
My main point is that it would be nice to have just very fast execute engine
and all library as integration layer
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
CPython is portable but due to integrated standard library (builtin
functionality) it is hard to evolve it, for examle to add JIT, anyway it is
just my thoughts
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to
Recently I have been thinking about why `JavaScript` with it's horrible type
system and lots of edge cases has supported so many platform and is very fast
...
First answer is simple, because big companies such as Google, Facebook and so
on evolve this language and run-time for it ...
But it
Today I think about lambda in Python and what if we introduce the new syntax:
```python
def lock(*args, closure):
# Do some stuff
closure() # Call closure
# Finish stuff
if __name__ == '__main__':
lock():
# Do some things here is thread safe
```
This feature could be very
Brett Cannon wrote:
> It's a discussion issue. PEP 554 is trying to focus on the API of
> subinterpreters and doesn't want to distract from that by bringing the GIL
> into it.
> That being said, the general expectation from everyone involved is there
> will be a perl-interpreter GIL.
> On Sat, Jun
Steven D'Aprano wrote:
> On Mon, Jun 29, 2020 at 10:20:40AM -, redrad...@gmail.com wrote:
> > Why I want that ?
> > Okay, here are the reasons:
> > 1) Security issue, should be fixed as soon as possible without waiting
> > 2 months or 1 year for next CPython release
> > That is an excellent
Chris Angelico wrote:
> On Fri, May 29, 2020 at 5:25 AM Alex Hall alex.moj...@gmail.com wrote:
> >
> > On Thu, May 28, 2020 at 12:57 PM Paul Sokolovsky pmis...@gmail.com wrote:
> > >
> > And in all fairness, all good ideas already came
> > to somebody else years
> > ago. There's
Steven D'Aprano wrote:
> On Tue, Jun 16, 2020 at 12:41:58PM -, redrad...@gmail.com wrote:
> > As long as I cannot update version of standard
> > library package
> > separately from CPython version - No, they are not separate creatures
> > ;)
> > Why would you want to? That just sounds like
Edwin Zimmerman wrote:
> This is still true. There are some of us that will scream very very loud if
> the std
> lib disappears from Python installers. However, I think there could easily
> be a way to
> satisfy both parties here. How difficult would it be to release both full
> and minimal
Paul Moore wrote:
> On Tue, 16 Jun 2020 at 11:53, Stéfane Fermigier s...@fermigier.com wrote:
> > the "batteries included" argument was a huge selling
> > points years ago (when Aaron Watters wrote "Internet Programming With
> > Python", for
> > instance) but I think the situation has changed
Stephen J. Turnbull wrote:
> Edwin Zimmerman writes:
> > This is still true. There are some of us that will
> > scream very
> > very loud if the std lib disappears from Python installers.
> > However, I think there could easily be a way to satisfy both
> > parties here. How difficult would it
Ned Batchelder wrote:
> On 5/25/20 6:02 AM, redrad...@gmail.com wrote:
> > Hi all,
> > I do not know maybe it was already discussed ...
> > It's been extensively discussed and attempted.
> > but the toolchain like LLVM is very mature and it can
> > provide the simpler JIT compilation to machine
Guido van Rossum wrote:
> In Python 3.10 we will no longer be burdened by the old parser (though 3rd
> party tooling needs to catch up).
> One thing that the PEG parser makes possible in about 20 lines of code is
> something not entirely different from the old print statement. I have a
>
Rhodri James wrote:
> On 16/06/2020 10:23, redrad...@gmail.com wrote:
> > I think it would be desired to modularize Python
> > library and then to
> > provide part of standard library through PyPi It will add possibility
> > to evolve separately run-time and standard library
> > Uh, aren't the
Rhodri James wrote:
> On 16/06/2020 10:23, redrad...@gmail.com wrote:
> > I think it would be desired to modularize Python
> > library and then to
> > provide part of standard library through PyPi It will add possibility
> > to evolve separately run-time and standard library
> > Uh, aren't the
I like what they `Pycopy` maintainers did !!
I allow to evolve separately runt-time and standard library ;)
Library maintainer could provide fixes to library faster than waiting one year
release cycle of CPython
___
Python-ideas mailing list --
Hi all, me again ... )
I think it would be desired to modularize Python library and then to provide
part of standard library through PyPi
It will add possibility to evolve separately run-time and standard library
I think standard library should be as small as needed and all other
functionality
Yeah, but it still desire to be solved ...
One of the use-cases is if I want to use `Brython`, it will be usable to load
the module or entire package from the internet and then to use it in my
application ...
Issue with the right to access some resources could be solve with flags as
`Deno`
You cannot trust PyPi either ...
I think user should decide if it allows code from arbitrary URL to access
filesystem, network or anything else as `wasmtime` and `deno` did
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an
What if we introduce the string module:
```python
from "https://python.org/some_module.py; import name
...
```
It will add possibility to run code with complex name of module that cannot be
presented as set of lexical items and also will allow to load the module from
external location
The question is why not to apply all this patches to CPython to be able
to compile CPython on the Web ?
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Thanks, but I know about this implementation ...
But my question is why not to apply all this patches to `CPython` to be able to
compile `CPython` on the Web ?
https://github.com/iodide-project/pyodide
https://github.com/dgym/cpython-emscripten
Patches to CPython seems pretty straightforward
Hi all,
I love Python, but as soon as I need to do something in browser I have to use
ugly JavaScript !!
Is there any future plans support for compiling CPython to WebAssembly using
Emscripten ?
___
Python-ideas mailing list --
I've just share information, relax ;)
And also it seems like they have very low overhead with atomic variables Arc
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Yesterday RustPython team finished threading without GIL:
https://github.com/RustPython/RustPython/issues/1831
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Cool !!
But it disappointed that this proposal was reject (
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message
Hi all,
In Python we often use the following syntax to call the main logic of script
when it was ran:
```python
def main():
pass # whatever should be done for `python ./script.py`
if __name__ == '__main__':
main()
```
Maybe it is a time to introduce the new module level function like
Thanks Guido !!
I have not known about `pyston` ... It is pretty good like for me
I will take a close look at this project
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Edwin Zimmerman wrote:
> On Monday, May 25, 2020 redrad...@gmail.com [mailto:redrad...@gmail.com]
> wrote
> > Edwin Zimmerman wrote:
> > On 5/25/2020 5:56 AM, redrad...@gmail.com
> > wrote:
> > Edwin Zimmerman wrote:
> > Sub-interpreters are a work in progress. The API is not anywhere near
> >
redradist@gmail.com wrote:
> Chris Angelico wrote:
> > On Mon, May 25, 2020 at 7:58 PM redrad...@gmail.com
> > wrote:
> > >
> > Edwin Zimmerman wrote:
> > Only if your workload is CPU bound. Python optimizes IO bound workload
> > performance by
> >
Chris Angelico wrote:
> On Mon, May 25, 2020 at 7:58 PM redrad...@gmail.com
> wrote:
> >
> > Edwin Zimmerman wrote:
> > Only if your workload is CPU bound. Python optimizes IO bound workload
> > performance by
> > releasing the GIL while doing IO. Green threads generally do not offer
> > this
Edwin Zimmerman wrote:
> On 5/25/2020 5:56 AM, redrad...@gmail.com wrote:
> > Edwin Zimmerman wrote:
> > Only if your workload is CPU bound. Python optimizes IO bound workload
> > performance by
> > releasing the GIL while doing IO. Green threads generally do not offer
> > this option.
> > Real
Hi all,
I do not know maybe it was already discussed ... but the toolchain like LLVM is
very mature and it can provide the simpler JIT compilation to machine code
functionality and it will improve performance of the Python a lot !!
___
Python-ideas
>> Edwin Zimmerman wrote:
Only if your workload is CPU bound. Python optimizes IO bound workload
performance by
releasing the GIL while doing IO. Green threads generally do not offer this
option.
Real threads is not needed in Python:
1) Real threads do not work parallel
2) Real threads only
Hi all,
I am very exciting about the sub-interpreters ... but I do not like some parts
...
Consider the following code:
```python
import _xxsubinterpreters as interpreters
import threading
import textwrap as tw
import marshal
if __name__ == '__main__':
# Create a sub-interpreter
63 matches
Mail list logo