Skip to content

Ticket1676 - dtype problem with append_fields#22

Closed
charris wants to merge 2 commits intonumpy:masterfrom
charris:ticket1676
Closed

Ticket1676 - dtype problem with append_fields#22
charris wants to merge 2 commits intonumpy:masterfrom
charris:ticket1676

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Nov 22, 2010

This is the patch attached to ticket 1676, it needs review.

@mwiebe
Copy link
Copy Markdown
Member

mwiebe commented Nov 23, 2010

The patch looks ok to me. The function itself has a few inconsistencies though:

  • two different ways to check for lists: isinstance(names, (tuple, list)): vs hasattr(dtypes, '__iter__'):
  • non-optional data has a default parameter value None

@charris
Copy link
Copy Markdown
Member Author

charris commented Nov 24, 2010

Thanks for the review. The hasattr(dtypes, 'iter'): looks like a potential bug, as iterables aren't guaranteed to support the len function. Tuple and list look like the right way to go, although one might argue for strings for setting names to ["a", "b",...]. That seems a bit a reach though. Other sequence types don't look appropriate. I've gone ahead and removed the None from the data and marked the dtype list as optional in the docs.

I'll commit it in tomorrow morning after I get some coffee.

You asked for commit rights a while back. Are you still interested?

@mwiebe
Copy link
Copy Markdown
Member

mwiebe commented Nov 24, 2010

The changes looks good. Yeah, I'm still interested in the commit rights.

@charris
Copy link
Copy Markdown
Member Author

charris commented Nov 25, 2010

Committed along with a regression test.

mattip referenced this pull request in mattip/numpy Mar 20, 2019
bashtage referenced this pull request in bashtage/numpy May 18, 2019
fangerer pushed a commit to hpyproject/numpy-hpy that referenced this pull request Jul 7, 2022
…ialization

Merge in numpy-hpy from ss/port-more-init to labs-hpy-port

* commit '3cd9bf37f3355055482d0b3404189c606468f7bc':
  Remove debugging printf
  Add one more missing C API warning
  Remove busdaycalendar for the HPy example port
  multiarray mod init: convert setting of remaining types on module dict
  multiarray mod init: add C API warnings for unported parts
  multiarray mod init: convert setting of "flatiter" on module dict
  multiarray mod init: convert setting of "ndarray" on module dict
  multiarray mod init: do not leak the h_d handle
  multiarray mod init: convert datetime capsules creation
  multiarray mod init: convert API capsules creation
  multiarray mod init: convert HPyContext capsule creation
  Remove PyObject* for module from the multiarray module init
  Port initumath
  Convert set_flaginfo
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants