Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket1676 - dtype problem with append_fields #22

Closed
wants to merge 2 commits into from

Conversation

charris
Copy link
Member

@charris charris commented Nov 22, 2010

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

@mwiebe
Copy link
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
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
Member

mwiebe commented Nov 24, 2010

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

@charris
Copy link
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
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.

None yet

2 participants