X-1.0rc3: Sikuli's "type" command collides with Jython's type command --- workarounds

Bug #906343 reported by David Michael Pennington
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Low
RaiMan

Bug Description

*** workarounds see comment #1

----------------------------------------------------

The issue is simple, long-time Jython users have no intuitive way to use Jython's traditional 'type()' command to introspect data types [Ref 1].

This is a serious problem for anyone who is used to Jython. When we get any kind of data, it is normal to look at it to ensure that you got what you expected (particularly since Jython uses duck typing) [Ref 2].

References:
[1]: http://www.jython.org/jythonbook/en/1.0/DataTypes.html
[2]: http://www.jython.org/jythonbook/en/1.0/ObjectOrientedJython.html

Tags: jython
Revision history for this message
RaiMan (raimund-hocke) wrote :

This is a long known problem and might be solved in a future version by an alternative command for Sikuli's type().

Meanwhile (especially for people used to Python/Jython ;-) there are some workarounds

# --1
import __builtin__
s = "x"
print __builtin__.type(s) == __builtin__.type("")

or even
import __builtin__ as __b
s = "x"
print __b.type(s) == __b.type("")

#--2
print isinstance(s, str)

#--3
print s.__class__.__name__

summary: - Sikuli's "type" command collides with Jython's type command
+ Sikuli's "type" command collides with Jython's type command ---
+ workarounds
description: updated
RaiMan (raimund-hocke)
summary: - Sikuli's "type" command collides with Jython's type command ---
- workarounds
+ X-1.0rc3: Sikuli's "type" command collides with Jython's type command
+ --- workarounds
Changed in sikuli:
status: New → Confirmed
RaiMan (raimund-hocke)
Changed in sikuli:
status: Confirmed → Fix Committed
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → x1.0
RaiMan (raimund-hocke)
tags: removed: type
RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → In Progress
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: x1.0 → none
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers