I see the following in the most recent (beta) release of Sage:

sage: g1=Graph([(0,'a')])
sage: g1.vertices()
<ipython-input-2-8314ec1f36bb>:1: DeprecationWarning: parameter 'sort' will 
be set to False by default in the future
See http://trac.sagemath.org/22349 for details.
  g1.vertices()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 g1.vertices()

File ~/Desktop/Sage/git/sage/src/sage/graphs/generic_graph.py:11196, in 
GenericGraph.vertices(self, sort, key, degree, vertex_property)
  11193     raise ValueError('sort keyword is False, yet a key function is 
given')
  11195 if sort:
> 11196     return sorted(self.vertex_iterator(degree=degree, 
vertex_property=vertex_property), key=key)
  11197 return list(self.vertex_iterator(degree=degree, 
vertex_property=vertex_property))

TypeError: '<' not supported between instances of 'int' and 'str'


You could instead use `g1.vertices(sort=False)` or as you suggested,  
`g1.vertices(key=hash)`, but `g1.vertices()` with no extra arguments is 
going to produce an error.


On Friday, August 19, 2022 at 5:05:23 AM UTC-7 ggun...@gmail.com wrote:

> On Wed, Jul 13, 2022 at 5:46 PM John H Palmieri <jhpalm...@gmail.com> 
> wrote:
> >
> > "Fix your old code" could just mean using `vertices(sort=False)`. See 
> also https://trac.sagemath.org/ticket/22349.
> >
>
> fixing the sort() appears easy:
>
> >>> li=['a',0]
> >>> li.sort(key=hash);li
> [0, 'a']
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/00d56adb-0059-4470-a2a3-5db5e537c435n%40googlegroups.com.

Reply via email to