Ben Finney :
> What well-defined data type exists with the following properties:
>
> * Mapping, key → value.
>
> * Each key is a sequence (e.g. `tuple`) of items such as text strings.
>
> * Items in a key may be the sentinel `ANY` value, which will match any
> value at that position.
>
> * A key
On Thu, Jul 16, 2015 at 1:31 AM, Ben Finney wrote:
> Fine by me. What is the mapping API that needs to be implemented though?
Have a look at collections.MutableMapping.
--
Zach
--
https://mail.python.org/mailman/listinfo/python-list
Ethan Furman writes:
> On 07/15/2015 10:53 PM, Ben Finney wrote:
> > Are those the ‘__contains__’, ‘__getitem__’ methods? What actually
> > is the API of a mapping type, that would need to be customised for
> > this application?
>
> The problem is that potential key matches are found by hashes
F
Chris Angelico writes:
> I'm not sure you really need a mapping type per se.
My reasons include (but I can probably think of more) testing membership
via the ‘key in mapping’ syntax.
> with the "match any" concept, there's actually a potential for
> ambiguities, which means you need a sequentia
On 07/15/2015 10:53 PM, Ben Finney wrote:
Steven D'Aprano writes:
You can't use a dict for the mapping, not unless you're smarter than
me, due to the requirement to hash the keys.
Dang. It's the mapping that I really need to solve, I think. A mapping
that has a custom “does this candidate m
On Thu, Jul 16, 2015 at 3:55 PM, Ben Finney wrote:
> Thanks. The part which puzzle me though: How do we teach the mapping
> type about that matching behaviour?
I'm not sure you really need a mapping type per se. The benefit of
something like Python's dict is that it gives really fast lookups via
On 7/15/2015 9:03 PM, Rick Johnson wrote:
You may have solved your input capturing problem, and i
don't think a GUI is the preferred solution for a
graphically deficient device anyhow, but you may well need a
GUI in the future, and this would be a fine example from which
to learn.
This really
Terry Reedy writes:
> On 7/15/2015 9:51 PM, Ben Finney wrote:
> > What well-defined data type exists with the following properties:
> >
> > * Mapping, key → value.
> >
> > * Each key is a sequence (e.g. `tuple`) of items such as text strings.
> >
> > * Items in a key may be the sentinel `ANY` val
Steven D'Aprano writes:
> Sounds like a regular expression. Remember that computer science
> theoretical regular expressions don't just match strings, they can
> apply to any sequence of primitive values.
Good insight, thank you.
> In your case, you only need two special tokens, match-one and
>
On 7/15/2015 9:51 PM, Ben Finney wrote:
Howdy all,
What well-defined data type exists with the following properties:
* Mapping, key → value.
* Each key is a sequence (e.g. `tuple`) of items such as text strings.
* Items in a key may be the sentinel `ANY` value, which will match any
value a
On 07/15/2015 07:03 PM, Rick Johnson wrote:
>
I think you've missed the whole point of the OP's project. He doesn't
want to make a GUI. He simply wants to have his program do something
like blink an LED when someone presses a big red button. He just wanted
a quick way to test things out since
On Thu, 16 Jul 2015 11:51 am, Ben Finney wrote:
> Howdy all,
>
> What well-defined data type exists with the following properties:
>
> * Mapping, key → value.
>
> * Each key is a sequence (e.g. `tuple`) of items such as text strings.
>
> * Items in a key may be the sentinel `ANY` value, which
On Thu, Jul 16, 2015 at 1:33 PM, Rick Johnson
wrote:
> On Wednesday, July 15, 2015 at 10:11:43 PM UTC-5, Chris Angelico wrote:
>> That's a neat trick, as long as you actually do have a console.
>
> Well if you don't have a console, another option is to use the
> dialogs of the "batteries included
On Wednesday, July 15, 2015 at 10:11:43 PM UTC-5, Chris Angelico wrote:
> That's a neat trick, as long as you actually do have a console.
Well if you don't have a console, another option is to use the
dialogs of the "batteries included GUI" named Tkinter.
from tkMessageBox import showinfo # Syn
On Thu, Jul 16, 2015 at 1:01 PM, Larry Hudson via Python-list
wrote:
> On 07/15/2015 05:11 AM, Chris Angelico wrote:
>>
>> On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote:
>>>
>>> I can't understand very well what's happening. It seems that the main
>>> thread gets blocked listening to the web se
On 07/15/2015 05:11 AM, Chris Angelico wrote:
On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote:
I can't understand very well what's happening. It seems that the main thread
gets blocked listening to the web server. My intent was to spawn another
process for the server independent of the test.
Howdy all,
What well-defined data type exists with the following properties:
* Mapping, key → value.
* Each key is a sequence (e.g. `tuple`) of items such as text strings.
* Items in a key may be the sentinel `ANY` value, which will match any
value at that position.
* A key may specify that
On Friday, June 19, 2015 at 12:20:14 AM UTC-5, Christian Gollwitzer wrote:
> The nonsense starts here:
>
> [...snip code...]
>
> it seems you don't understand event based programming.
Duh. No need to abuse the lad.
> It waits for the user input and does the dispatching, i.e.
> when a key is pr
On 15/07/2015 23:34, Gregory Ewing wrote:
Mark Lawrence wrote:
IIRC the realms of the C setjmp and longjmp.
Not really the same thing. A longjmp chops the stack
back, whereas a tail call avoids putting something on
the stack to begin with.
Thanks for that :)
--
My fellow Pythonistas, ask n
Antoon Pardon wrote:
But it doesn't need to be all or nothing. How about the following possibility.
When the runtime detects a serie of tail calls, it will keep the bottom three
and the top three backtrace records of the serie.
Whatever value you choose for N, keeping only the
first/last N trac
Mark Lawrence wrote:
IIRC the realms of the C setjmp and longjmp.
Not really the same thing. A longjmp chops the stack
back, whereas a tail call avoids putting something on
the stack to begin with.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico wrote:
Which really says that TCO is impossible if you have any sort of
clean-up or deallocation to be done after the call begins. The only
way to truly turn your tail call into a GOTO is to do all your cleanup
first.
Indeed. In compilers that implement TCO, there's quite
a lot m
On 15/07/2015 22:54, David Karr wrote:
I'm just learning more about Python (although I've been a Java dev for many
years, and C/C++ before that).
Welcome to the world of sanity after years of insanity :)
A book I'm reading (Learning Python Network Programming) refers to running "pyvenv". I
I'm just learning more about Python (although I've been a Java dev for many
years, and C/C++ before that).
A book I'm reading (Learning Python Network Programming) refers to running
"pyvenv". I can find this in my Win7 environment, but I was planning on using
my CentOS7 VM for most of this. I
On 7/15/2015 5:29 AM, Antoon Pardon wrote:
On 07/13/2015 05:44 PM, Th. Baruchel wrote:
Hi, after having spent much time thinking about tail-call elimination
in Python (see for instance http://baruchel.github.io/blog/ ), I finally
decided to write a module for that. You may find it at:
https:
On 07/15/2015 01:05 PM, John McKenzie wrote:
> Hello, all.
>
> Thanks to everyone who responded to my post.
>
> I decided to make sure I had something that worked with what I have now
> and used Curses to finish it. However, it turns out that the extra work
> and problems with using GPIO pin
Hello, all.
Thanks to everyone who responded to my post.
I decided to make sure I had something that worked with what I have now
and used Curses to finish it. However, it turns out that the extra work
and problems with using GPIO pins and wiring up controllers that way is a
small amount of
On Thu, Jul 16, 2015 at 3:13 AM, Gary Roach wrote:
> Every time I try to do a python manage.py migrate I get:
> django.db.utils.OperationalError: FATAL: password
> authentication failed for user "postgres"
> FATAL: password authentication failed for user "postgres"
>
>
> DATABASES = {
>
Every time I try to do a python manage.py migrate I get:
django.db.utils.OperationalError: FATAL: password authentication
failed for user "postgres"
FATAL: password authentication failed for user "postgres"
System Debian linux jessie
python 2.79
Django 1.8
Postgresql 9.4.3 database
Using v
We are pleased to announce the official guidebook for the EuroPython 2015
conference:
*** https://ep2015.europython.eu/en/events/mobile-schedule/ ***
We will regularly issue updates to the guidebook when there are changes in
schedule.
Available for all platforms
---
I built and installed Python from Mercurial tip (head, whatever), so I have
a Python 3.6.0a0 available. I created a virtualenv using that.
Q1: Suppose I install something like matplotlib into that virtualenv which
itself contains extension modules. Those will depend on the include files
and shared
Ian Kelly :
> On Tue, Jul 14, 2015 at 11:27 AM, Marko Rauhamaa wrote:
>> You'll see that the generated code is tail-call-optimized.
>
> This can't be done generally, though. What if, instead of a local
> variable, the assignment were to a dict item? Even if the dict itself
> is a local variable,
On Tue, Jul 14, 2015 at 11:27 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Tue, Jul 14, 2015 at 2:33 AM, Marko Rauhamaa wrote:
>>> The programmer shouldn't be controlling tail call optimizations.
>>
>> The programmer controls it regardless.
>>
>> return foo() # TCO
>>
>> result = foo(
On Wed, Jul 15, 2015 at 7:13 PM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>>
>> I'm still interested in the explicit "replace current stack frame with
>> this call" operation. Calling it "goto" seems wrong, as most languages
>> with goto restrict it to _within_ a function,
>
>
> This just sugg
On Wed, Jul 15, 2015 at 10:00 PM, MRAB wrote:
> On 2015-07-15 12:22, Mark Lawrence wrote:
>>
>> On 15/07/2015 10:13, Gregory Ewing wrote:
>>>
>>> Chris Angelico wrote:
I'm still interested in the explicit "replace current stack frame with
this call" operation. Calling it "goto" seem
On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote:
> I can't understand very well what's happening. It seems that the main thread
> gets blocked listening to the web server. My intent was to spawn another
> process for the server independent of the test. Obviously I'm doing something
> wrong. I'v
On 2015-07-15 12:22, Mark Lawrence wrote:
On 15/07/2015 10:13, Gregory Ewing wrote:
Chris Angelico wrote:
I'm still interested in the explicit "replace current stack frame with
this call" operation. Calling it "goto" seems wrong, as most languages
with goto restrict it to _within_ a function,
Hi all!
I'm working in a little Python exercise with testing since the beginning. So
far I'm with my first end to end test (not even finished yet) trying to:
1) Launch a development web server linked to a demo app that just returns
'Hello World!'
2) Make a GET request successfully
I can't un
Ned Batchelder :
> On Wednesday, July 15, 2015 at 6:56:10 AM UTC-4, Marko Rauhamaa wrote:
>> Ned Batchelder :
>> > I don't understand this, can you explain more? Are you saying that the
>> > Python specification shouldn't specify what x becomes?:
>> >
>> > def who_knows():
>> > pass
>>
On 15/07/2015 10:13, Gregory Ewing wrote:
Chris Angelico wrote:
I'm still interested in the explicit "replace current stack frame with
this call" operation. Calling it "goto" seems wrong, as most languages
with goto restrict it to _within_ a function,
This just suggests to me is that most lang
On Wednesday, July 15, 2015 at 6:56:10 AM UTC-4, Marko Rauhamaa wrote:
> Ned Batchelder :
>
> > On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
> >> The other problem for tail call elimination is the requirement that
> >> functions return None by default. Smooth tail call el
On 07/15/2015 12:55 PM, Marko Rauhamaa wrote:
> Ned Batchelder :
>
>> On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
>>> The other problem for tail call elimination is the requirement that
>>> functions return None by default. Smooth tail call elimination would
>>> require t
On 15/07/2015 08:27, Chris Withers wrote:
Hi All,
I'm pleased to announce the release of xlrd 0.9.4:
http://pypi.python.org/pypi/xlrd/0.9.4
This release includes the following changes:
- Automated tests are now run on Python 3.4
- Use ElementTree.iter() if available, not deprecated getiter
Ned Batchelder :
> On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
>> The other problem for tail call elimination is the requirement that
>> functions return None by default. Smooth tail call elimination would
>> require that Python leave the default return value unspecified
On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
> Gregory Ewing :
>
> > Marko Rauhamaa wrote:
>
> >> It might even be tail-call optimized by Python. Only you can't count
> >> on it because the language spec doesn't guarantee it.
> >
> > The language spec might permit it, bu
EuroPython is not the only attraction in Bilbao to attend in July. The city
also hosts the famous *Guggenheim Museum*, featuring modern art in an
amazing building designed by Frank O. Gehry.
See below for a special deal we have available for the Guggenheim.
You can also find the *Fine Arts Museu
Gregory Ewing :
> A tail call *is* a goto. That's how you implement one in assembly
> language -- you write a jump instruction instead of a call
> instruction. The jump doesn't have to be to the same function.
In functional programming languages you might not even have a call
stack. Instead, you
On 7/14/2015 12:28 PM, Marcos wrote:
Hi!
Just like many, I want the projects in which I work on to move to Python 3.
And incredibly, there are a few users on the same project who refuse to
use python 3 simply because of the print statement.
That has probably already been discussed, but since I
On 07/13/2015 05:44 PM, Th. Baruchel wrote:
> Hi, after having spent much time thinking about tail-call elimination
> in Python (see for instance http://baruchel.github.io/blog/ ), I finally
> decided to write a module for that. You may find it at:
>
> https://github.com/baruchel/tco
>
> Tail-cal
Chris Angelico wrote:
I'm still interested in the explicit "replace current stack frame with
this call" operation. Calling it "goto" seems wrong, as most languages
with goto restrict it to _within_ a function,
This just suggests to me is that most language designers
are not very imaginative. :-
On 07/15/2015 02:41 AM, Terry Reedy wrote:
> On 7/14/2015 10:02 AM, Antoon Pardon wrote:
>> On 07/14/2015 03:43 PM, Chris Angelico wrote:
>>> On Tue, Jul 14, 2015 at 11:38 PM, Marko Rauhamaa
>>> wrote:
>
No, tail call optimization doesn't change the behavior of the program,
for the worse
On 15/07/2015 09:08, Kasper Jepsen wrote:
Hi,
I am looking for a solution to graph charts from real time measurements on the
web like:
http://pvoutput.org/intraday.jsp?id=16919&sid=14707&gs=1&dxa=1&dt=20150715
I have some solar systems i like to save data into an sql datab
On 07/14/2015 07:48 PM, Steven D'Aprano wrote:
> On Wed, 15 Jul 2015 03:29 am, Marko Rauhamaa wrote:
>
>> Chris Angelico :
>>
>>> On Tue, Jul 14, 2015 at 11:38 PM, Marko Rauhamaa
>>> wrote:
No, tail call optimization doesn't change the behavior of the
program, for the worse anyway.
>>> I
Hi,
I am looking for a solution to graph charts from real time measurements on the
web like:
http://pvoutput.org/intraday.jsp?id=16919&sid=14707&gs=1&dxa=1&dt=20150715
I have some solar systems i like to save data into an sql database - and then i
like to have some web ser
On Wed, Jul 15, 2015 at 2:28 AM, Marcos wrote:
> And incredibly, there are a few users on the same project who refuse to use
> python 3 simply because of the print statement.
Solution: Explain to them the massive benefits of the print function.
It may be simpler to omit the parentheses in the cas
On Tuesday, 14 July 2015 17:24:22 UTC+5:30, Chris Angelico wrote:
> On Tue, Jul 14, 2015 at 7:20 AM, Thomas Via wrote:
> > I'm trying to reinstall Python 2.7.9/2.7.10, but during the installation, it
> > didn't let me, which gave me this:
> >
> > "There is a problem with this Windows Installer pa
On Tue, Jul 14, 2015 at 8:47 PM, Steve Hayes wrote:
> On Tue, 14 Jul 2015 17:31:31 -0700 (PDT), trentonwesle...@gmail.com
> wrote:
>
>>Greetings!
>>You been Invited as a Beta User for TheGongzuo.com ( Absolutely Extended
>>Trial).
>>We bring to you TheGongzuo.com, Top notch highly talented IT (In
Hi!
Just like many, I want the projects in which I work on to move to Python 3.
And incredibly, there are a few users on the same project who refuse to
use python 3 simply because of the print statement.
That has probably already been discussed, but since I actually couldn't
find anything re
58 matches
Mail list logo