473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sub-classing NumArray - two questions

numarray is a package which is under development and intended to replace
Numeric, an efficient and operational package.

One of the classes in numarray is NumArray. As currently implemented,
instances of this class are instantiated using factory functions. This
appears to restrict the sub-classing of NumArray

Examples: a sub-class Matrix, an array restricted to two dimensions, or
a sub-class Mix, which combines the NumArray with RecArray (another
class in the numarray package), or even a sub-class of matrix, Symmetric
(to use more efficient storage)

These cannot readily be built using factory functions. This has been
discussed on the NumPy list
(http://lists.sourceforge.net/lists/l...mpy-discussion) and the
question was posed:

Q1
Can someone please explain what the "new-classes standard" is?
(Obviously meeting it is not one of our current goals)

Another related question:

Q2
It seems that certain flaws were perceived in Numeric (NumPy),
developed in 1997 by Jim Hugunin. Development of numarray was
started to produce an array package which could become a standard
Python package. What were the flaws seen in Numeric?

Colin W.

Background from the NumPY list:

Regarding the "new-classes standard", I can't find much in either the
Python docs or Alex Martelli's "Python in a Nutshell". One of the new
features is a __new__ constructor.

The Python array module doesn't formally have a class and thus it can't
be sub-classed. It uses a factory function to create instance objects.

Martelli, in PIAN p74, writes of factory functions being useful when one
wishes to create instances of different classes depending on some
condition or for the reuse of an existing instance.

In the Python Cookbook p173, he proposes the use of a factory function
to get around the limitations of Python 2.1 and earlier. On page 179,
he refers to the use of a factory method, again to work around
limitations before Python 2.2.

My rough and ready definition would include the ability to create an
instance and initialize
the data in one step.

cjw

Jul 18 '05 #1
0 1449

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
2
by: tshad | last post by:
I have an example I copied from "programming asp.net" (o'reilly) and can't seem to get the Sub (writefile) to execute. It displays all the response.write lines that are called directly, but not...
5
by: Colleyville Alan | last post by:
I have a sub that can do two different tasks based on the value of one variable. So I'd like to have two different buttons on the same form run this, but each one setting a flag so that the...
3
by: Kathy Burke | last post by:
Hi, I'm tired, so this question may be silly. I have a fairly long sub procedure. Based on one condition, I load another sub with the following: If Session("GRN") = "complete" Then txtScan.Text...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
12
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
5
by: Sharon | last post by:
Hi all. To prevent access to a sub system internal types, is it necessary to create the sub system in a different project, and use the internal access level? Or is there another way that will...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
6
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.