Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params)
В списке pgsql-hackers по дате отправления:
| От | David Blewett |
|---|---|
| Тема | Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params) |
| Дата | |
| Msg-id | 9d1f8d830811060810h5e023e28x79b04c6262d8d5af@mail.gmail.com обсуждение |
| Ответ на | Re: ARRAY vars (was Enable pl/python to return records based on multiple OUT params) (Hannu Krosing <hannu@2ndQuadrant.com>) |
| Список | pgsql-hackers |
On Tue, Nov 4, 2008 at 4:17 PM, Hannu Krosing <hannu@2ndquadrant.com> wrote: > One open question is how to translate arrays with non-default subscript > values > > Quote: "Subscripted assignment allows creation of arrays that do not use > one-based subscripts. For example one might assign to myarray[-2:7] to > create an array with subscript values running from -2 to 7." > > Should I just shift it to standard python tuple, or would it be better > to return it as a dictionary with keys from -2 to 7 I think changing the base type is bound to cause issues. For example, suppose someone expects to be able to simply iterate over the array. If they're assuming it's a list, they will expect the values to be returned. If it's a dictionary, the keys will be. If you're going to do that, you'd need to do a custom dict class that iterated over the values I think. David Blewett
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера