Steve D'Aprano wrote:
If PIC is so great, why do no other languages have it?
Something akin to it has turned up in other places, although
usually in the guise of an output formatting facility rather
than a way of describing how data is stored internally.
For example, the PRINT USING found in s
Ian Kelly wrote:
Yikes. I never took the time to learn COBOL, but that almost sounds
like something that you'd find in an esoteric language like INTERCAL.
COBOL has other fun stuff like that, too. For example, the
destination of a GOTO statement can be changed from elsewhere
in the program:
ht
Gregory Ewing :
> Steve D'Aprano wrote:
>
>> If PIC is so great, why do no other languages have it?
>
> Something akin to it has turned up in other places, although usually
> in the guise of an output formatting facility rather than a way of
> describing how data is stored internally. For example,
Christian Gollwitzer :
> Am 13.04.17 um 15:20 schrieb Marko Rauhamaa:
>>
>> Not sure if this is still valid:
>>
>>Still today Flash RAM cells built in SSDs have a limited lifespan.
>>Every write (not read) cycle or better every erasure wears a memory
>>cell and at some time it will sto
On 14/04/2017 02:44, Steve D'Aprano wrote:
On Fri, 14 Apr 2017 12:52 am, bartc wrote:
I know this isn't the Python need-for-speed thread, but this is a
classic example where the lack of one simple feature leads to using
slower, more cumbersome ones.
Dear gods, have I fallen back in time to 19
On 14/04/2017 03:13, Steve D'Aprano wrote:
On Wed, 12 Apr 2017 07:56 pm, bart4...@gmail.com wrote:
if you care most about program correctness, type-safety and
correctness proofs, choosing C is probably the wrong decision.
CPython is written in C; bad choice?
(** Although I find code full o
On Fri, Apr 14, 2017 at 8:42 PM, bartc wrote:
>> Classes and decorators are not esoteric. You sound like an old man who
>> complains about this new-fangled "telephone", and how things were so much
>> better when we had messenger boys to deliver messages anywhere in the
>> city.
>
>
> These days I
On 14/04/2017 11:56, Chris Angelico wrote:
On Fri, Apr 14, 2017 at 8:42 PM, bartc wrote:
Classes and decorators are not esoteric. You sound like an old man who
complains about this new-fangled "telephone", and how things were so much
better when we had messenger boys to deliver messages anywher
On Fri, Apr 14, 2017 at 10:04 PM, bartc wrote:
>
>> Of course, if you feel the other way, you're most welcome to write
>> everything in C.
>
>
> 'pseudo-code' is often the language used to describe an algorithm in terms
> that are independent of any particular language. It doesn't usually contain
On 2017-04-13, Jason Friedman wrote:
>> I have this code which I got from https://www.tutorialspoint.
>> com/python/python_command_line_arguments.htm The example works fine but
>> when I modify it to what I need, it only half works. The problem is the
>> try/except. If you don't specify an input/ou
On 2017-04-13, Mikhail V wrote:
> On 13 April 2017 at 18:48, Ian Kelly wrote:
>> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote:
>>> Now I wonder, have we already collected *all* bells and whistles of Python
>>> in these two examples, or is there something else for expressing trivial
>>> thin
On 2017-04-13, Grant Edwards wrote:
> On 2017-04-13, Rob Gaddi wrote:
>
>> No, C doesn't support exception handling. As a result, handling error
>> conditions in C is a huge pain for which (forward-only) goto is often,
>> while not the only remedy, the least painful one.
>
> Indeed. That is alm
Bernd Nawothnig wrote:
> On 2017-04-13, Mikhail V wrote:
> > On 13 April 2017 at 18:48, Ian Kelly wrote:
> >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote:
> >>> Now I wonder, have we already collected *all* bells and whistles of Python
> >>> in these two examples, or is there something els
On Sat, Apr 15, 2017 at 12:13 AM, Dennis Lee Bieber
wrote:
> On Thu, 13 Apr 2017 18:36:57 -0600, Ian Kelly
> declaimed the following:
>
>>
>>Well, you can do it in Assembly. And BASIC, if you count the primitive
>>GOSUB-type subroutines, though modern BASICs have real subroutines
>>that don't all
every time i run the program i get this messeage:
Traceback (most recent call last):
File "smartmirror.py", line 159, in get_weather
temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])),
degree_sign)
KeyError: 'currently'
Error: 'currently'. Cannot get weather.
How do i
On Sat, 15 Apr 2017 12:27 am, Kasper wrote:
> every time i run the program i get this messeage:
>
> Traceback (most recent call last):
> File "smartmirror.py", line 159, in get_weather
> temprature2 = "%S%S" %
> (str(int(weather_obj['currently']['temperature'])),
> degree_sign)
> KeyErr
I am running some tests using the site regex101 to figure out the correct
regexs to use for a project. I was surprised at how slow it was, constantly
needing to increase the timeouts. I went Googling for a reason, and solution,
and found Russ Cox’s article from 2007:
https://swtch.com/~rsc/rege
On Sat, 15 Apr 2017 01:12 am, Malik Rumi wrote:
> I couldn’t understand why, if this was even remotely correct,
> we don’t use NFA in Python
[...]
> I don’t think I’m qualified to take on the idea of creating
> a new NFA module for Python.
If not you, then who should do it?
Python is open so
Kasper wrote:
> every time i run the program i get this messeage:
>
> Traceback (most recent call last):
> File "smartmirror.py", line 159, in get_weather
> temprature2 = "%S%S" % (str(int(weather_obj['currently']
['temperature'])),
> degree_sign)
> KeyError: 'currently'
> Error: 'currently
-Original Message-
From: Python-list [mailto:python-list-
bounces+jcasale=activenetwerx@python.org] On Behalf Of Malik Rumi
Sent: Friday, April 14, 2017 9:12 AM
To: python-list@python.org
Subject: Regular Expressions, Speed, Python, and NFA
> I am running some tests using the site rege
Malik Rumi wrote:
> I am running some tests using the site regex101 to figure out the correct
> regexs to use for a project. I was surprised at how slow it was,
> constantly needing to increase the timeouts. I went Googling for a reason,
> and solution, and found Russ Cox’s article from 2007:
> ht
On 04/14/2017 07:19 AM, Dennis Lee Bieber wrote:
On Fri, 14 Apr 2017 11:44:59 +1000, Steve D'Aprano
declaimed the following:
Even that's not enough for some. Donald Knuth, who supports the use of GOTO
under some circumstances, maintains that any program using GOTOs should
have the invariant t
On 04/14/2017 08:12 AM, Malik Rumi wrote:
I am running some tests using the site regex101 to figure out the correct
regexs to use for a project. I was surprised at how slow it was, constantly
needing to increase the timeouts. I went Googling for a reason, and solution,
and found Russ Cox’s art
On 04/13/2017 08:13 PM, Steve D'Aprano wrote:
> On Wed, 12 Apr 2017 07:56 pm, bart4...@gmail.com wrote:
> [...]
>> (** Although I find code full of class definitions, one-liners, decorators
>> and all the other esoterics, incomprehensive. I'm sure I'm not the only
>> one, so perhaps readability isn
On 4/14/2017 10:27 AM, Kasper wrote:
every time i run the program i get this messeage:
Traceback (most recent call last):
File "smartmirror.py", line 159, in get_weather
temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])),
degree_sign)
KeyError: 'currently'
Error: 'cu
Peter,
Retracing my steps to rewrite the getattr(row, label) code, this is what
sent me down the rabbit hole in the first place. (I changed your 'rows'
to 'records' just to use the same name everywhere, but all else is the
same as you gave me.) I'd like you to look at it and see if you still
think
I have an python3 C++ extension that works.
But dir(obj) does not return the list of member variables.
How should I support dir() from the C API?
I cannot use tp_members, not appropiate to the code I'm writing.
If I provide __dir__ I then hit the problem I need the C API version
all_attr
r...@zedat.fu-berlin.de (Stefan Ram):
> struct example
> { PIC<5,X<15>> last_name;
> PIC<88,VALUE<1,3,5,7,9>> odd_numbers; }
>
> . The above assumes appropriate definitions for »VALUE« (as a
> variadic template) »PIC«, and »X«. Only a C++ expert would be able
> to provide thes
Deborah Swanson wrote:
> Peter,
>
> Retracing my steps to rewrite the getattr(row, label) code, this is what
> sent me down the rabbit hole in the first place. (I changed your 'rows'
> to 'records' just to use the same name everywhere, but all else is the
> same as you gave me.) I'd like you to l
On 2017-04-14 20:34, Deborah Swanson wrote:
Peter,
Retracing my steps to rewrite the getattr(row, label) code, this is what
sent me down the rabbit hole in the first place. (I changed your 'rows'
to 'records' just to use the same name everywhere, but all else is the
same as you gave me.) I'd lik
bartc writes:
> I do know that if I want to port some program (be it in Python or
> C++), or simply try and understand it, if I see it's full of class
> definitions or whatever, then I won't bother.
There was a time in the evolution of OOP when inheritance was thought of
as a cool and enabling th
On Wednesday, April 12, 2017 at 1:48:57 AM UTC-5, Steven D'Aprano wrote:
> On Tue, 11 Apr 2017 21:10:56 -0700, Rick Johnson wrote:
>
> > high level languages like Python should make it difficult,
> > if not impossible, to write sub- optimal code (at least in
> > the blatantly obvious cases).
>
> Yo
On Wednesday, April 12, 2017 at 4:30:16 AM UTC-5, alister wrote:
> On Tue, 11 Apr 2017 16:31:16 -0700, Rick Johnson wrote:
> > On Tuesday, April 11, 2017 at 9:56:45 AM UTC-5, Steve D'Aprano wrote:
> >> On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote:
> >> > On 2017-04-11 08:19:31 +, Steven
fix = {label: max(values, key=len)}
group[:] = [record._replace(**fix) for record in group]
Peter Otten wrote, on Friday, April 14, 2017 2:16 PM
> > def complete(group, label):
> > values = {row[label] for row in group}
> > # get "TypeError: tuple indices must be integers, not str"
>
> Ye
MRAB wrote, on Friday, April 14, 2017 2:19 PM
>
> In the line:
>
> values = {row[label] for row in group}
>
> 'group' is a list of records; row is a record (namedtuple).
>
> You can get the members of a namedtuple (also 'normal' tuple) by
numeric
> index, e.g. row[0], but the point of a n
On Wednesday, April 12, 2017 at 4:34:00 AM UTC-5, Brecht Machiels wrote:
> On 2017-04-11 14:56:33 +, Steve D'Aprano said:
> > On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote:
> [...]
> However, we don't really know how Python's performance is
> affecting its popularity. It would be good to
On 15/04/2017 00:40, Rick Johnson wrote:
On Wednesday, April 12, 2017 at 1:48:57 AM UTC-5, Steven D'Aprano wrote:
answer = 0
for i in range(10):
answer += 1
instead of
answer = 10
So... how exactly does the compiler prohibit stupid code?
Easy. The same way _any_ optimi
Gregory Ewing wrote, on Thursday, April 13, 2017 12:17 AM
>
> Deborah Swanson wrote:
> > But I think you got it right in your last sentence below.
defaultdict
> > copied them because they were immutable,
>
> No, definitely not. A defaultdict will never take it upon
> itself to copy an object yo
Peter Otten wrote:
PS: Personally I would probably take the opposite direction and use dicts
throughout...
Yes, my suggestion to used namedtuples in the first place was
based on the assumption that you would mostly be referring to
fields using fixed names. If that's not true, then using
namedt
Roel Schroeven wrote, on Thursday, April 13, 2017 5:26 PM
>
> Gregory Ewing schreef op 13/04/2017 9:34:
> > Deborah Swanson wrote:
> >> Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM
> >>
> >>> Personally I would immediately discard the header row
> once and for
> >>> all, not again and
Dennis Lee Bieber wrote:
And since the original COBOL standard numeric format was BCD, PIC not
only defined output layout, but also internal storage needed by numerics
and string data types.
Unless you said USAGE IS COMPUTATIONAL, which left the compiler
free to pick a more efficient st
On Wednesday, April 12, 2017 at 4:57:10 AM UTC-5, bart...@gmail.com wrote:
> On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote:
> > On Tue, 11 Apr 2017 21:10:56 -0700, Rick Johnson wrote:
> > >
> > > high level languages like Python should make it
> > > difficult, if not impossible
On Wednesday, April 12, 2017 at 8:44:30 AM UTC-5, bart...@gmail.com wrote:
> On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote:
> > bartc writes:
> > >
> > > These are straightforward language enhancements.
> >
> > FYI, the question is not how to optimize the code but how
> > to
On Thursday, April 13, 2017 at 1:32:29 AM UTC-5, Gregory Ewing wrote:
> Jussi Piitulainen wrote:
> > Traceback (most recent call last):
> > File "/dev/fd/63", line 37, in
> > SanityClauseException: code is blatantly sub-optimal
> >
> > As far as I know, no language does that. Because reasons?
>
On Thursday, April 13, 2017 at 1:32:28 AM UTC-5, Steven D'Aprano wrote:
> On Wed, 12 Apr 2017 14:38:52 +0100, Ben Bacarisse wrote:
> > Steve D'Aprano writes:
> >> On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote:
>
> [...] Indeed, and this is a very common phenomenon:
> features which "ordinary" prog
On Thursday, April 13, 2017 at 7:39:38 AM UTC-5, Rustom Mody wrote:
> Quote from Peter Landin, one of the precursors of modern
> functional programming: Most papers in computer science
> describe how their author learned what someone else already
> knew [And this dates from 60s/70s] Applies beyo
46 matches
Mail list logo