++
there is a lot of cruft around managing memory and allocating sizes, not
to mention additional verbiage. In Python you are far freer to
concentrate on the data structures and algorithms themselves.
Maybe start here:
https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms
less so) in C++
> there is a lot of cruft around managing memory and allocating sizes, not
> to mention additional verbiage. In Python you are far freer to
> concentrate on the data structures and algorithms themselves.
>
> Maybe start here:
>
>
> https://d
ing sizes, not
to mention additional verbiage. In Python you are far freer to
concentrate on the data structures and algorithms themselves.
Maybe start here:
https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms%20tutorials
Cheers,
Cameron Simpson
--
https://mail.python.or
Hi, I am currently in learning process of python have been worked on
some desktop application using pyqt . I want improve my DSA area but i
searched so many videos mot sure how to start . 1.Do i really need learn
datastructures in c or c++ to get complete logical details. 2 .or shall
i start learn
On 30Mar2019 10:29, Paul Moore wrote:
On Fri, 29 Mar 2019 at 23:21, Cameron Simpson wrote:
On 27Mar2019 18:41, Paul Moore wrote:
>I'm looking for a library that lets me parse binary data structures.
>The stdlib struct module is fine for simple structures, but when it
&g
On Fri, 29 Mar 2019 at 23:21, Cameron Simpson wrote:
>
> On 27Mar2019 18:41, Paul Moore wrote:
> >I'm looking for a library that lets me parse binary data structures.
> >The stdlib struct module is fine for simple structures, but when it
> >gets to more complicated
On 30Mar2019 09:44, Cameron Simpson wrote:
On 27Mar2019 18:41, Paul Moore wrote:
I'm looking for a library that lets me parse binary data structures.
The stdlib struct module is fine for simple structures, but when it
gets to more complicated cases, you end up doing a lot of the work by
On 27Mar2019 18:41, Paul Moore wrote:
I'm looking for a library that lets me parse binary data structures.
The stdlib struct module is fine for simple structures, but when it
gets to more complicated cases, you end up doing a lot of the work by
hand (which isn't that hard, and is
On 2019-03-29 16:34:35 +, Paul Moore wrote:
> On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote:
>
> > Obviously you need some way to describe the specific binary format you
> > want to parse - in other words, a grammar. The library could then use
> > the grammar to parse the input - either
On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote:
> Obviously you need some way to describe the specific binary format you
> want to parse - in other words, a grammar. The library could then use
> the grammar to parse the input - either by interpreting it directly, or
> by generating (Python)
On 3/29/19 12:13 PM, Peter J. Holzer wrote:
Obviously you need some way to describe the specific binary format you
want to parse - in other words, a grammar. The library could then use
the grammar to parse the input - either by interpreting it directly, or
by generating (Python) code from it. Th
On 2019-03-28 11:07:22 +0100, dieter wrote:
> Paul Moore writes:
> > My real interest is in whether any libraries exist to do this sort
> > of thing (there are plenty of parser libraries for text, pyparsing
> > being the obvious one, but far fewer for binary structures).
Paul Moore writes:
> On Thu, 28 Mar 2019 at 08:15, dieter wrote:
> ...
> My real interest is in whether any
> libraries exist to do this sort of thing (there are plenty of parser
> libraries for text, pyparsing being the obvious one, but far fewer for
> binary structures)
very
similar to how I'd approach that. My real interest is in whether any
libraries exist to do this sort of thing (there are plenty of parser
libraries for text, pyparsing being the obvious one, but far fewer for
binary structures).
Paul
--
https://mail.python.org/mailman/listinfo/python-list
Paul Moore writes:
> I'm looking for a library that lets me parse binary data structures.
> The stdlib struct module is fine for simple structures, but when it
> gets to more complicated cases, you end up doing a lot of the work by
> hand (which isn't that hard, and is gene
I'm looking for a library that lets me parse binary data structures.
The stdlib struct module is fine for simple structures, but when it
gets to more complicated cases, you end up doing a lot of the work by
hand (which isn't that hard, and is generally perfectly viable, but
I'
> On Jun 18, 2017, at 11:02 PM, Chris Angelico wrote:
>
> On Mon, Jun 19, 2017 at 3:54 PM, Steven D'Aprano wrote:
>>> With a list? No, I would say it's a bad idea.
>>
>>
>> Why a bad idea?
>>
>> As opposed to "can't be done", or "too hard and slow".
>
> Maintaining a record of list indices i
On Mon, Jun 19, 2017 at 3:54 PM, Steven D'Aprano wrote:
>> With a list? No, I would say it's a bad idea.
>
>
> Why a bad idea?
>
> As opposed to "can't be done", or "too hard and slow".
Maintaining a record of list indices inside an object, with the
specific proviso that:
> If the list is change
On Mon, 19 Jun 2017 06:04:57 +1000, Chris Angelico wrote:
> On Mon, Jun 19, 2017 at 5:27 AM, wrote:
>> I am thinking of a list that actively maintains in its items a member
>> that contains the item's own index in the list. Basically, the item
>> knows its index into the list and the list ensur
On Mon, Jun 19, 2017 at 5:27 AM, wrote:
> I am thinking of a list that actively maintains in its items a member that
> contains the item's own index in the list. Basically, the item knows its
> index into the list and the list ensures that the index remains in sync. If
> the list is changed,
I'm not sure if "reciprocal" is the right word, or if there is an official term
for this.
I am thinking of a list that actively maintains in its items a member that
contains the item's own index in the list. Basically, the item knows its index
into the list and the list ensures that the index
On 04-Oct-16 04:48, eryk sun wrote:
On Mon, Oct 3, 2016 at 9:27 PM, Michael Felt wrote:
int perfstat_subsystem_total(
perfstat_id_t *name,
perfstat_subsystem_total_t *userbuff,
int sizeof_struct,
int desired_number);
...
+79 class cpu_total:
+80 def __init__(self
On Wed, Oct 5, 2016 at 9:03 PM, Michael Felt wrote:
>
>> +80 args = (1, "name", None), (2, "buff", None), (1, "size",
>> 0), (1, "count", 1)
>
> error #1. paramater type 2 (the buffer might be where data is being put, but
> for the call, the pointer is INPUT)
An output parameter (type 2)
Never said thank you - so, thanks!
What I need to do was add the .v at the end so I was accessing the value
of the structure.
Unlilke Linux, AIX - for reasons unknown to all, they have the time_t
definition that is specific to the ABI size, at least for these
performance libraries that proba
On 05-Oct-16 22:29, Emile van Sebille wrote:
Thanks for the reply!
After a shirt coffeebreak - back into the fray - and I found the following:
+76 class cpu_total:
+77 def __init__(self):
+78 __perfstat__ = CDLL("libperfstat.a(shr_64.o)")
+79 prototype = CFUNC
On 10/05/2016 01:06 PM, Michael Felt wrote:
On 02-Oct-16 19:50, Michael Felt wrote:
I am trying to understand the documentation re: ctypes and interfacing
with existing libraries.
I am reading the documentation, and also other sites that have largely
just copied the documentation - as well as
On 02-Oct-16 19:50, Michael Felt wrote:
I am trying to understand the documentation re: ctypes and interfacing
with existing libraries.
I am reading the documentation, and also other sites that have largely
just copied the documentation - as well as the "free chapter" at
O'Reilly (Python Co
On Mon, Oct 3, 2016 at 9:27 PM, Michael Felt wrote:
>
> int perfstat_subsystem_total(
>perfstat_id_t *name,
>perfstat_subsystem_total_t *userbuff,
>int sizeof_struct,
>int desired_number);
> ...
>+79 class cpu_total:
>+80 def __init__(self):
>+81 __perfst
use, should be NULL
perfstat_subsystem_total_t *userbuff A pointer to a memory area with
enough space for the returned structure
int sizeof_struct Should be set to sizeof(perfstat_subsystem_t)
int desired_number Reserved for future use, must be set to 0 or 1
The return value wil
On 03-Oct-16 16:35, Michael Felt wrote:
I'd alias the type instead of defining a struct, e.g. `time_t =
c_long`. This preserves automatic conversion of the simple type.
The reason for the not using alias is because a) I was trying to be
more inline with the text of the include file.
I will hav
On Mon, Oct 3, 2016 at 2:35 PM, Michael Felt wrote:
> On 02-Oct-16 23:44, eryk sun wrote:
>> On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt
>> wrote:
>>
>>> b) what I am not understanding - as the basic documentation shows
>>> FOO.value as the way to set/get the value of a _field_
>>
>> You may b
On 02-Oct-16 23:44, eryk sun wrote:
On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote:
a) where is documentation on "CField"'s?
It's undocumented.
So I do not feel so bad about not finding anything :)
A CField is a data descriptor that accesses a
struct field with the given type, size,
On 02-Oct-16 23:44, eryk sun wrote:
On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote:
>
>a) where is documentation on "CField"'s?
I will reply more later - just a quick thanks.
Not using maxsize will be good, also in a different patch - also
specific to AIX.
This "thing" I am working
On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote:
>
> a) where is documentation on "CField"'s?
It's undocumented. A CField is a data descriptor that accesses a
struct field with the given type, size, and offset. Like most
descriptors, it's meant to be accessed as an attribute of an instance,
n
I am trying to understand the documentation re: ctypes and interfacing
with existing libraries.
I am reading the documentation, and also other sites that have largely
just copied the documentation - as well as the "free chapter" at
O'Reilly (Python Cookbook).
I am missing anything on CFields
On Sunday, July 17, 2016 at 3:45:04 AM UTC+5:30, Shrey Desai wrote:
> I have found it slightly frustrating that Python does not have built-in
> support for advanced data structures (Linked Lists, Stacks/Queues, BST) in
> its distribution. Many computer science students, developers, and
MRAB :
> Given that Python has dict, there's not much need for a binary search tree.
Dicts don't have the concept of key order. I use my own AVL tree to
implement timers. A balanced tree data structure is the only major data
structure I've missed in Python. It is there in Java and C++, for
example
On 2016-07-17 08:19, Chris Angelico wrote:
> Why do you need a linked list? That's an implementation detail; why
> not simply use a regular list?
>
> Not trolling, genuinely asking. Is there something that you
> specifically need those exact structures for?
I know there ha
On Sun, 17 Jul 2016 08:14 am, shrey.de...@gmail.com wrote:
> I have found it slightly frustrating that Python does not have built-in
> support for advanced data structures (Linked Lists, Stacks/Queues, BST) in
> its distribution.
They are hardly "advanced" data structures. Th
s fine at doing that
- the concepts of a linked list translate nicely into Python objects
and attributes - even though it'll never actually be something Python
needs. Once you've learned what the different fundamental structures
are, you'll have a better understanding of what's goin
On 17Jul2016 12:43, Chris Angelico wrote:
On Sun, Jul 17, 2016 at 12:33 PM, Paul Rubin wrote:
Chris Angelico writes:
keep a reference to an element deep in the list, and insert a new
element in O(1) time at that point.
at the C level, wouldn't tracing the links cost massively more than
the
On 2016-07-17 03:33, Paul Rubin wrote:
Chris Angelico writes:
keep a reference to an element deep in the list, and insert a new
element in O(1) time at that point.
at the C level, wouldn't tracing the links cost massively more than
the occasional insertion too? I'm not sure O(1) is of value at
On Sun, Jul 17, 2016 at 12:33 PM, Paul Rubin wrote:
> Chris Angelico writes:
>>> keep a reference to an element deep in the list, and insert a new
>>> element in O(1) time at that point.
>> at the C level, wouldn't tracing the links cost massively more than
>> the occasional insertion too? I'm no
Chris Angelico writes:
>> keep a reference to an element deep in the list, and insert a new
>> element in O(1) time at that point.
> at the C level, wouldn't tracing the links cost massively more than
> the occasional insertion too? I'm not sure O(1) is of value at any
> size, if the costs of all
On Sun, Jul 17, 2016 at 10:54 AM, wrote:
> Well, in a larger context you can keep a reference to an element deep in the
> list, and insert a new element in O(1) time at that point.
>
I'd like to know how many elements your list needs before that
actually becomes faster than CPython's heavily-opt
thing.
- Development: the use of correct data structures is important when
developing applications, especially for issues like scaling and efficiency.
For instance, when working with polynomials, Linked Lists provide a great
interface to access and edit them.
What does having links gai
On 2016-07-17 01:10, Terry Reedy wrote:
On 7/16/2016 6:14 PM, shrey.de...@gmail.com wrote:
I have found it slightly frustrating that Python does not have
built-in support for advanced data structures (Linked Lists,
You and I have different ideas of 'advanced data structures' ;
On 7/16/2016 6:14 PM, shrey.de...@gmail.com wrote:
I have found it slightly frustrating that Python does not have
built-in support for advanced data structures (Linked Lists,
You and I have different ideas of 'advanced data structures' ;-). To
me, linked list are limited structur
On Saturday, July 16, 2016 at 11:15:04 PM UTC+1, Shrey Desai wrote:
> I have found it slightly frustrating that Python does not have built-in
> support for advanced data structures (Linked Lists, Stacks/Queues, BST) in
> its distribution. Many computer science students, developers, and
shrey.de...@gmail.com writes:
> As a computer science undergraduate student, I don't want to spend
> time writing the module but instead I want to work with it, play
> around with it, and do problems with it.
For educational purposes, I think writing the module yourself is part of
the idea. Also,
On Sun, Jul 17, 2016 at 8:33 AM, Shrey Desai wrote:
> Hi Chris, thanks for the reply. There's a couple of reasons why I would need
> a Linked List (and other data structures):
> - Education: the Linked List is a core data structure that CS undergraduates
> (among others) use an
On Saturday, July 16, 2016 at 3:19:56 PM UTC-7, Chris Angelico wrote:
> On Sun, Jul 17, 2016 at 8:14 AM, wrote:
> > I have found it slightly frustrating that Python does not have built-in
> > support for advanced data structures (Linked Lists, Stacks/Queues, BST) in
> > i
On Sun, Jul 17, 2016 at 8:14 AM, wrote:
> I have found it slightly frustrating that Python does not have built-in
> support for advanced data structures (Linked Lists, Stacks/Queues, BST) in
> its distribution. Many computer science students, developers, and software
> engineers r
I have found it slightly frustrating that Python does not have built-in support
for advanced data structures (Linked Lists, Stacks/Queues, BST) in its
distribution. Many computer science students, developers, and software
engineers rely on these data structures; having the data structures be a
nges. I will
> continue to add to the repo on a regular basis. I'm hoping you find it useful
> as a fun, hands-on way to learn or to sharpen your skills on algorithms and
> data structures, while helping yourself prep for coding interviews and coding
> challenges.
>
>
ay to learn or to sharpen your skills on algorithms and
data structures, while helping yourself prep for coding interviews and coding
challenges.
Let me know if you have any questions or comments. Contributions are welcome!
-Donne
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for that. I will have a play and see how I can apply your example.
On 07/01/2014, at 11:19 PM, Jean-Michel Pichavant
wrote:
> - Original Message -
>> Thanks for that. It resolved the issue and it was so simple compared
>> to everything else I saw on the net.
>>
>> Only outstandi
- Original Message -
> Thanks for that. It resolved the issue and it was so simple compared
> to everything else I saw on the net.
>
> Only outstanding thing I have to work out is how to execute functions
> from a dictionary. I will continue searching on the net.
>
>
> Sean
This may hel
"Sean Murphy" wrote in message
news:0cf6151e-e063-4252-9ac3-4fd4698eb...@gmail.com...
> Hello all.
>
> I have some questions again. :-)
>
> I wish to be able to place a function within a data structure. I would
> like to use a dictionary because I could pass it a key and then the
> function co
Sean Murphy wrote:
> Only outstanding thing I have to work out is how to execute functions from
> a dictionary. I will continue searching on the net.
I don't quite understand this question. Do you mean something like this?
def spam(n):
return "spam"*n
def eggs(n):
return "eggs"*n
d =
Thanks for that. It resolved the issue and it was so simple compared to
everything else I saw on the net.
Only outstanding thing I have to work out is how to execute functions from a
dictionary. I will continue searching on the net.
Sean
On 07/01/2014, at 9:21 PM, Jean-Michel Pichavant wrote
- Original Message -
> Hello all.
>
> I have some questions again. :-)
>
> I wish to be able to place a function within a data structure. I
> would like to use a dictionary because I could pass it a key and
> then the function could be called. I couldn't find anything on the
> net to s
Hello all.
I have some questions again. :-)
I wish to be able to place a function within a data structure. I would like to
use a dictionary because I could pass it a key and then the function could be
called. I couldn't find anything on the net to show me how to do this. More
then likely, not
On Wed, Dec 18, 2013 at 8:32 PM, wrote:
>
> Hi all,
>While performing the packing/unpacking of xdr structures of rpc I get an
> error as following.
>
>
> x = struct.unpack('>L', data)[0] struct.error: unpack requires a string
> argument of length 4.
&
Hi all,
While performing the packing/unpacking of xdr structures of rpc I get an
error as following.
x = struct.unpack('>L', data)[0] struct.error: unpack requires a string
argument of length 4.
Can anybody help me in this regard?
I checked the following link:
http://docs
Thanks for all these very clarifying and useful replies
--
http://mail.python.org/mailman/listinfo/python-list
Am 21.11.2012 17:04, schrieb hfo...@gmail.com:
Thanks for your reply, but the javascript function expects option
names to be unquoted, otherwise it won't work.
Others have shown you how to solve this, but I would like to note that
the function does NOT expect JSON but a simple javascript object
On Wed, Nov 21, 2012 at 7:48 AM, MRAB wrote:
> On 2012-11-21 14:59, saikari78 wrote:
>>
>> Hi,
>>
>> I'm using the json module to create a JSON string, then inserting that
>> string into a html template containing a javascript function (from the
>> highcharts library: http://www.highcharts.com/)
On 2012-11-21 16:27, MRAB wrote:> On 2012-11-21 16:04, hfo...@gmail.com
wrote:
>> On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
>>> On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then
inserting that string into a ht
On 2012-11-21 16:04, hfo...@gmail.com wrote:
On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then
inserting that string into a html template containing a javascript
>>> function (from th
On 2012-11-21, MRAB wrote:
>> However, I don't know how to do that because dictionary keys in
>> python need to be strings. If I try to do the following, Python,of
>> course, complains that y,color,drilldown, etc are not defined.
>
> Just quote them:
>
> data = [ { 'y':55.11, 'color':colors[0], '
Thanks for your reply, but the javascript function expects option names to be
unquoted, otherwise it won't work.
On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
> On 2012-11-21 14:59, saikari78 wrote:
>
> > Hi,
>
> >
>
> > I'm using the json module to create a JSON string, then
On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then inserting that string
into a html template containing a javascript function (from the highcharts
library: http://www.highcharts.com/)
The json string I'm trying to create is to initialize a data
Hi,
I'm using the json module to create a JSON string, then inserting that string
into a html template containing a javascript function (from the highcharts
library: http://www.highcharts.com/)
The json string I'm trying to create is to initialize a data variable in the
javascript function, th
Hi there,
I am trying to use a pkcs11 library (with python 2.7) and address this
library with ctypes.
Alas, I am neither the python black belt guru and C is not my preferred
language.
Till now, I do not want to use pykcs11, since I want to keep my
dependencies low.
I initialized the library, log
On Thu, Mar 1, 2012 at 8:55 PM, Alec Taylor wrote:
> What would you recommend I use to compare data-structures and
> algorithms on space and time? (runtime)
For the latter metric, one of the profiling modules:
http://docs.python.org/library/debug.html
I'd start with timeit and go
What would you recommend I use to compare data-structures and
algorithms on space and time? (runtime)
Thanks for all suggestions,
Alec Taylor
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, May 2, 2011 at 7:46 PM, Rita wrote:
> Hello,
> I was wondering if anyone has any documentation/recipes for implementing
> complex data structures. For instance, if you had a dictionary with a list
> inside a list inside a set.
Er, there's no special magic. The da
Hello,
I was wondering if anyone has any documentation/recipes for implementing
complex data structures. For instance, if you had a dictionary with a list
inside a list inside a set.
--
--- Get your facts first, then you can distort them as you please.--
--
http://mail.python.org/mailman
Physics Python wrote:
Hello,
I am teaching myself python using the book: Python Programming for Absolute
Beginners, 2nd edition by Michael Dawson. I am using python 2.7.1.
In chapter 3 we are learning to use structures (while, if, elif) to write a
program that has the user guess a number
looping = True
while looping:
guess = int(raw_input("Take a guess: "))
tries += 1
if guess > the_number:
print "Lower..."
elif guess < the_number:
print "Higher..."
else:
print "You guessed it! The number was", the_number
print "And it only took y
In case you still need help:
- # Set the initial values
- the_number= random.randrange(100) + 1
- tries = 0
- guess = None
-
- # Guessing loop
- while guess != the_number and tries < 7:
- guess = int(raw_input("Take a guess: "))
- if guess > the_number:
- print "Lower..."
-
On 2011-01-12, Jason Staudenmayer wrote:
> Return False instead of break should work
>
> else:
> print "You guessed it! The number was", the_number
> print "And it only took you", tries, "tries!\n"
> return False
Since he isn't in a function, that isn't any good. He wo
[wrapped lines to <80 characters per RFC 1855]
On 2011-01-12, Physics Python wrote:
> Is this an indentation problem then?
That depends how you look at it. I was not clear from your code exactly
where you wanted to handle things.
> How do I update the sentinel within the secondary while loop. I
gt; python-list-bounces+jasons=adventureaquarium@python.org
> [mailto:python-list-bounces+jasons=adventureaquarium@pytho
> n.org] On Behalf Of Physics Python
> Sent: Wednesday, January 12, 2011 2:53 PM
> To: python-list@python.org
> Subject: Re: Nested structures question
>
Thanks,
Is this an indentation problem then?
How do I update the sentinel within the secondary while loop. I am trying to
avoid using breaks by the way, as I can program this example using breaks:
--- start---
import random
print "\tWelcome to 'Guess my number'!:"
print "\nI'm thinking of a numb
On 2011-01-12, Physics Python wrote:
> while guess != the_number:
=
> while tries > 7:
> if guess > the_number:
> print "Lower..."
> else:
> print "Higher..."
> guess = int(raw_input("Take a guess:
Hello,
I am teaching myself python using the book: Python Programming for Absolute
Beginners, 2nd edition by Michael Dawson. I am using python 2.7.1.
In chapter 3 we are learning to use structures (while, if, elif) to write a
program that has the user guess a number between 1 and 100.
Here is
uot; and "disconnect" in
> separate structures and reference them within pyDEV_CALLBACKS?
Solved.
The answer was in the doc:
http://docs.python.org/library/ctypes.html#structured-data-types
(_fields_ & _pack_).
--
http://mail.python.org/mailman/listinfo/python-list
rap "connect", "transceive" and "disconnect" in
separate structures and reference them within pyDEV_CALLBACKS?
The (stub) code I wrote for now looks like this:
class pyDEV_CALLBACKS(Structure):
_fields_ = [("acDriver", c_char_p), ("connect", c_void_
On Nov 22, 7:55 am, Simon Forman wrote:
> On Sun, Nov 22, 2009 at 4:50 AM, Diez B. Roggisch wrote:
>
>
>
> > Steve Howell schrieb:
>
> >> On Nov 21, 4:07 pm, MRAB wrote:
>
> >>> I don't see the point of EvalNode and PrettyPrintNode. Why don't you
> >>> just give Integer, Sum and Product 'eval' a
On Sun, Nov 22, 2009 at 4:50 AM, Diez B. Roggisch wrote:
> Steve Howell schrieb:
>>
>> On Nov 21, 4:07 pm, MRAB wrote:
>>>
>>> I don't see the point of EvalNode and PrettyPrintNode. Why don't you
>>> just give Integer, Sum and Product 'eval' and 'pprint' methods?
>>
>> That's a good question, and
Steve Howell schrieb:
On Nov 21, 4:07 pm, MRAB wrote:
I don't see the point of EvalNode and PrettyPrintNode. Why don't you
just give Integer, Sum and Product 'eval' and 'pprint' methods?
That's a good question, and it's the crux of my design dilemma. If
ALL I ever wanted to to with Integer/S
Steve Howell wrote:
My objection to the interface you describe is that Node defines the
type of operations that can be done to it by third-party code, which
is something that I cannot predict
I think you have the right idea with a mapping from node
classes to implementations of operations, but
etic expressions. My particular problem involves a
mini-language that describes how you want to descend Python data
structures.
> But maybe that's not what you need. No need to overengineer if it is
> though, keep it simple, simple is better than complex.
Yep! I am trying to keep thin
On 22 Nov, 00:07, MRAB wrote:
> Steve Howell wrote:
> > I have been writing some code that parses a mini-language, and I am
> > running into what I know is a pretty common design pattern problem,
> > but I am wondering the most Pythonic way to solve it.
>
> > Basically, I have a bunch of really si
On Nov 21, 4:07 pm, MRAB wrote:
>
> I don't see the point of EvalNode and PrettyPrintNode. Why don't you
> just give Integer, Sum and Product 'eval' and 'pprint' methods?
That's a good question, and it's the crux of my design dilemma. If
ALL I ever wanted to to with Integer/Sum/Product was to ev
Steve Howell wrote:
I have been writing some code that parses a mini-language, and I am
running into what I know is a pretty common design pattern problem,
but I am wondering the most Pythonic way to solve it.
Basically, I have a bunch of really simple classes that work together
to define an exp
I have been writing some code that parses a mini-language, and I am
running into what I know is a pretty common design pattern problem,
but I am wondering the most Pythonic way to solve it.
Basically, I have a bunch of really simple classes that work together
to define an expression--in my oversim
eave in the square brackets for __getitem__
> lookups on these:
>
> > .person 'name',
> > .person 'location' as city,
>
Yep, I agree. The square brackets were not a deliberate omission.
They were just slightly more t
1 - 100 of 376 matches
Mail list logo