473,626 Members | 3,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1466

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

Similar topics

5
4051
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
2218
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 any of the response.write lines from inside the sub. ******************************************* <%@ Application Language="VB" %> <script runat="server">
5
3255
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 conditional logic knows which one to run. Here is what I have in mind: If Button_One_Was_Pressed then link = PerfArray(iCtr).strFund_Name & ".Doc" else
3
2462
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 = Session("SN") txtScan_TextChanged(sender, e) Session("GRN") = "" Exit Sub End If
10
21297
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 sender As System.Object, _ ByVal e As System.EventArgs) _ Handles mnuTopics_Show.Select Dim mShowMenuItem As MenuItem mShowMenuItem = DirectCast(sender, MenuItem)
12
7069
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 raise an event instead of just calling the sub? Scenario1 -- Using Events ------------------------------------------------------ Public Class Form1
1
3393
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 Subtask to Task by pressing a button that makes each subform invisible/visible. The problem exists when I try to navigate from Element to Task to Subtask. Sub-subform Element will become invisible and show Task but when I press the button to go...
5
1903
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 enable the creation of several sub systems in the same project? Thanks, Sharon.
6
4859
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 why. I've been exploring using Access as a front end to both SQL MSDE and Oracle XE. I'm in the process of writing a class to handle the basics of the ADO connection and recordsets. The basic relationships are as follows:
6
2266
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 a standard way to gain control within the sub-forms to do individual clean-up prior to their removal?
0
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.