[issue44475] Dataclass Causes Infinite Recursion when using type of bytes

2021-06-21 Thread Andrew C


New submission from Andrew C :

Hello,

When given a `Field` on a Dataclass, the `__repr__` throws an infinite 
recursive error when the data type is bytes.

In the `Field` class, the __repr__ is as follows:

```
def __repr__(self):
return (
'Field('
f'name={self.name!r},'
f'type={self.type!r},'
f'default={self.default!r},'
f'default_factory={self.default_factory!r},'
f'init={self.init!r},'
f'repr={self.repr!r},'
f'hash={self.hash!r},'
f'compare={self.compare!r},'
f'metadata={self.metadata!r},'
f'_field_type={self._field_type}'
')'
)
```

The issue is the f'type={self.type!r}, part of the code.

--
components: Windows
messages: 396250
nosy: andrewonboe, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Dataclass Causes Infinite Recursion when using type of bytes
versions: Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue44475>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar

2021-02-02 Thread Andrew C. Morrow


New submission from Andrew C. Morrow :

When building with `--with-lto`, an explicit check for `llvm-ar` is performed 
as part of the configure step. However, Apple does not ship `llvm-ar` as part 
of Xcode, so when building with Apple Clang this check fails and prevents using 
`--with-lto`.

However, using the builtin `ar` seems to work just fine, and it can be selected 
by passing `LLVM_AR=/path/to/ar` to `configure`. It would be nice to see the 
`configure` script updated to know that system `ar` is sufficient when using 
Apple Clang on macOS.

Please see https://github.com/Homebrew/homebrew-core/pull/70177 for additional 
background.

--
components: Build
messages: 386174
nosy: acmorrow
priority: normal
severity: normal
status: open
title: When using Apple Clang, --with-lto builds should not check for llvm-ar
type: enhancement
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43109>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42989] Bug

2021-01-21 Thread Andrew C


New submission from Andrew C :

if playerChoice == "2": reports the ":" as a "syntax error"

--
components: Windows
messages: 385427
nosy: ASCRong, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Bug
type: behavior
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42989>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35111] Make Custom Object Classes JSON Serializable

2018-10-31 Thread andrew c


andrew c  added the comment:

Bob,

I understand what you are saying, but having a built-in is way easier than 
encoder/decoders.  You can still have both actually.  Even if you didn't have 
two way, a one way would be amazingly helpful.  For large development systems, 
a __json__ method would make serialization super easy.

class foo(object):
 a = 1
 b = [1,2,3]
 def __json__(self): return {'a':self.a,'b':self.b}

--

___
Python tracker 
<https://bugs.python.org/issue35111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35111] Make Custom Object Classes JSON Serializable

2018-10-30 Thread andrew c


New submission from andrew c :

When creating a custom class that doesn't inherit from the accepted classes, 
there is no way to serialize it using json.dumps or json.dump.  

I propose that __fromjson__ and __tojson__ that when present will be used by 
the Python's default encoder.  This issue is widely documented on stackoverflow 
as a deficiency. 

You basically have a couple of options to solve this:

1. Implement a custom  json.JSONEncoder/json.JSONDecoder
2. Implement a method like to/from json
3. Monkey patch the json library
4. Use a 3rd party library

These are not very good options.  If you can serialize an object using pickle, 
why not have the ability to serialize objects using json?

Thank you

--
messages: 328897
nosy: andrewchap
priority: normal
severity: normal
status: open
title: Make Custom Object Classes JSON Serializable
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue35111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3353] make built-in tokenizer available via Python C API

2014-06-22 Thread Andrew C

Andrew C added the comment:

The previously posted patch has become outdated due to signature changes 
staring with revision 89f4293 on Nov 12, 2009.  Attached is an updated patch.

Can it also be confirmed what are the outstanding items for this patch to be 
applied?  Based on the previous logs it's not clear if it's waiting for 
documentation on the struct tok_state or if there is another change requested.  
Thanks.

--
hgrepos: +260
nosy: +Andrew.C

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3353
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3353] make built-in tokenizer available via Python C API

2014-06-22 Thread Andrew C

Changes by Andrew C andrew.carr...@gmail.com:


Added file: http://bugs.python.org/file35730/82706ea73ada.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3353
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com